/[gzz]/gzz/gzz/view/LinebrokenCellContentView.java
ViewVC logotype

Diff of /gzz/gzz/view/LinebrokenCellContentView.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.20 by mudyc, Fri Jan 10 10:00:16 2003 UTC revision 1.21 by humppake, Fri Jan 10 11:26:47 2003 UTC
# Line 81  public static final String rcsid = "$Id$ Line 81  public static final String rcsid = "$Id$
81          else          else
82              s = widthString;              s = widthString;
83    
84            /**
85             * Width of LinebrokenCellContentView is the
86             * width of its longest line.
87             */
88          float w = style.getWidth(s, scale);          float w = style.getWidth(s, scale);
89            int linebreak = s.indexOf('\n');
90            if (linebreak != -1) {
91                w = style.getWidth(s.substring(0, linebreak), scale);
92                int anotherLinebreak = s.indexOf('\n', linebreak+1);
93                while (anotherLinebreak != -1) {
94                    float anotherWidth = style.getWidth(s.substring(linebreak+1, anotherLinebreak), scale);
95                    if (w < anotherWidth) w = anotherWidth;
96                    linebreak = anotherLinebreak;
97                    anotherLinebreak = s.indexOf('\n', linebreak+1);
98                }
99                float anotherWidth = style.getWidth(s.substring(linebreak+1, s.length()), scale);
100                if (w < anotherWidth) w = anotherWidth;
101            }
102    
103          float h;          float h;
104          if(c != null)          if(c != null)
105              h = getHeight(c, w, scale);              h = getHeight(c, w, scale);

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26