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

Diff of /gzz/gzz/view/TextCellContentView.java

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

revision 1.19 by tjl, Tue Oct 29 07:30:58 2002 UTC revision 1.20 by tjl, Fri Nov 1 19:53:52 2002 UTC
# Line 51  public static final String rcsid = "$Id$ Line 51  public static final String rcsid = "$Id$
51          this.style = style;          this.style = style;
52      }      }
53    
54      public void place(Cell c, VobScene v, Box box,      float[] boxwh = new float[2];
55        public void place(Cell c, VobScene vs, int box,
56                        ViewContext context) {                        ViewContext context) {
57          String s = c.t();          String s = c.t();
58          if (s == null) s = "";          if (s == null) s = "";
# Line 79  public static final String rcsid = "$Id$ Line 80  public static final String rcsid = "$Id$
80          float left = style.getWidth(s.substring(0, center), scale);          float left = style.getWidth(s.substring(0, center), scale);
81          float right = width - left;          float right = width - left;
82    
83          float middle = box.getWidth() / 2.0f;          vs.coords.getSqSize(box, boxwh);
84            float middle = boxwh[0] / 2.0f;
85    
86          // Possibly offset text so cursor is visible.          // Possibly offset text so cursor is visible.
87          float textOffset;          float textOffset;
88          if(width < box.getWidth()) textOffset = 0;          if(width < boxwh[0]) textOffset = 0;
89          else if(left < middle) textOffset = 0;          else if(left < middle) textOffset = 0;
90          else if(right < middle) textOffset = (- width + box.getWidth());          else if(right < middle) textOffset = (- width + boxwh[0]);
91          else textOffset = (- left + middle);          else textOffset = (- left + middle);
92    
93          Object key = (line < KEY.length) ? KEY[line] : new Integer(line+1);          Object key = (line < KEY.length) ? KEY[line] : new Integer(line+1);
94          int offsetcs = v.orthoCS(box.getWHCoordsys(), key, 0, textOffset, 0, 1, 1);          int offsetcs = vs.orthoCS(box, key, 0, textOffset, 0, 1, 1);
95    
96          placeVob(c, v, offsetcs, box.getWidth(), box.getHeight(), brBefore, brAfter, offs, context, scale);          placeVob(c, vs, offsetcs, boxwh[0], boxwh[1], brBefore, brAfter, offs, context, scale);
97      }      }
98    
99      static Object WH_KEY = new Object();      static Object WH_KEY = new Object();

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

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