gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gzz-commits] gzz/gzz/view LinebrokenCellContentView.java


From: Benja Fallenstein
Subject: Re: [Gzz-commits] gzz/gzz/view LinebrokenCellContentView.java
Date: Fri, 10 Jan 2003 12:45:09 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021226 Debian/1.2.1-9


Hi Asko!

Asko Soukka wrote:
Log message:
        Fixing LinebrokenCellContentView.getSize()

Can you explain this fix to me, please? I don't understand it :)
-b.

+       /**
+        * 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;
+       }
+
        float h;
        if(c != null)
            h = getHeight(c, w, scale);






reply via email to

[Prev in Thread] Current Thread [Next in Thread]