gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] fenfire/org/fenfire/view TextNodeView.java


From: Benja Fallenstein
Subject: [Gzz-commits] fenfire/org/fenfire/view TextNodeView.java
Date: Mon, 09 Jun 2003 11:10:43 -0400

CVSROOT:        /cvsroot/fenfire
Module name:    fenfire
Branch:         
Changes by:     Benja Fallenstein <address@hidden>      03/06/09 11:10:43

Modified files:
        org/fenfire/view: TextNodeView.java 

Log message:
        calculate the size of linebroken text
        correctly: when there is only a single line, don't use the
        line width used in linebreaking as the box's width (because the
        single line is probably shorter than the width used for
        linebreaking-- if it were longer, the line would have been
        broken).

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/view/TextNodeView.java.diff?tr1=1.5&tr2=1.6&r1=text&r2=text

Patches:
Index: fenfire/org/fenfire/view/TextNodeView.java
diff -u fenfire/org/fenfire/view/TextNodeView.java:1.5 
fenfire/org/fenfire/view/TextNodeView.java:1.6
--- fenfire/org/fenfire/view/TextNodeView.java:1.5      Sun Jun  8 07:21:00 2003
+++ fenfire/org/fenfire/view/TextNodeView.java  Mon Jun  9 11:10:43 2003
@@ -38,7 +38,7 @@
  *  currently, places text as a single very long line.
  */
 public class TextNodeView implements NodeFunction {
-public static final String rcsid = "$Id: TextNodeView.java,v 1.5 2003/06/08 
11:21:00 benja Exp $";
+public static final String rcsid = "$Id: TextNodeView.java,v 1.6 2003/06/09 
15:10:43 benja Exp $";
     public static boolean dbg = false;
     private static void pa(String s) { System.out.println("TextNodeView::"+s); 
}
 
@@ -67,6 +67,12 @@
        HChain ch = getChain(s);
        final HBroken br = breaker.breakLines(ch, width, scale);
        final float height = br.getHeight();
+
+       final float width;
+       if(br.getLineCount() > 1)
+           width = this.width;
+       else
+           width = br.getLineWidth(0);
 
        //final TextVob vob = new TextVob(style, s, false);
        //final float width = style.getWidth(s, scale);




reply via email to

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