/[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.21 by humppake, Fri Jan 10 11:26:47 2003 UTC revision 1.22 by benja, Fri Jan 10 19:27:39 2003 UTC
# Line 75  public static final String rcsid = "$Id$ Line 75  public static final String rcsid = "$Id$
75    
76      public void getSize(Cell c, float scale, ViewContext context,      public void getSize(Cell c, float scale, ViewContext context,
77                          float[] out) {                          float[] out) {
78          String s;          float w = style.getWidth(widthString, scale);
         if(c != null)  
             s = Containment.getContainedText(c);  
         else  
             s = widthString;  
   
         /**  
          * Width of LinebrokenCellContentView is the  
          * width of its longest line.  
          */  
         float w = style.getWidth(s, scale);  
         int linebreak = s.indexOf('\n');  
         if (linebreak != -1) {  
             w = style.getWidth(s.substring(0, linebreak), scale);  
             int anotherLinebreak = s.indexOf('\n', linebreak+1);  
             while (anotherLinebreak != -1) {  
                 float anotherWidth = style.getWidth(s.substring(linebreak+1, anotherLinebreak), scale);  
                 if (w < anotherWidth) w = anotherWidth;  
                 linebreak = anotherLinebreak;  
                 anotherLinebreak = s.indexOf('\n', linebreak+1);  
             }  
             float anotherWidth = style.getWidth(s.substring(linebreak+1, s.length()), scale);  
             if (w < anotherWidth) w = anotherWidth;  
         }  
   
79          float h;          float h;
80          if(c != null)          if(c != null)
81              h = getHeight(c, w, scale);              h = getHeight(c, w, scale);

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

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