Changeset 105 for trunk/src/org/expeditee/items/Text.java
- Timestamp:
- 06/20/08 12:55:35 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/items/Text.java
r98 r105 58 58 public static final int MINIMUM_RANGED_CHARS = 2; 59 59 60 public static final int UP = 0; 61 62 public static final int DOWN = 1; 63 64 public static final int LEFT = 2; 65 66 public static final int RIGHT = 3; 67 68 public static final int HOME = 4; 69 70 public static final int END = 5; 71 72 public static final int PAGE_DOWN = 6; 73 74 public static final int PAGE_UP = 7; 60 public static final int NONE = 0; 61 62 public static final int UP = 1; 63 64 public static final int DOWN = 2; 65 66 public static final int LEFT = 3; 67 68 public static final int RIGHT = 4; 69 70 public static final int HOME = 5; 71 72 public static final int END = 6; 73 74 public static final int PAGE_DOWN = 7; 75 76 public static final int PAGE_UP = 8; 75 77 76 78 private int _maxWidth = -1; … … 392 394 // move the cursor to the new location 393 395 float[] caret = last.getCaretInfo(hit); 394 int y = getLineDrop(last) * line;395 396 int x = ((int) (getX() + caret[0] ) + getJustOffset(last));396 float y = getLineDrop(last) * line; 397 398 int x = ((int) (getX() + caret[0] + 0.5) + getJustOffset(last)); 397 399 x = Math 398 400 .min( 399 401 x, 400 402 (getX() - Item.MARGIN_RIGHT - (2 * getGravity()) + getBoundsWidth())); 401 return new Point(x, getY() + /* DisplayIO.getOffset() + */y 402 + (int) caret[1]); 403 return new Point(x, (int) (getY() + y + caret[1] + 0.5)); 403 404 } 404 405 … … 614 615 // move the cursor to the new location 615 616 float[] caret = current.getCaretInfo(hit); 616 int y = getLineDrop(current) * line;617 618 int x = ( (int) (getX() + caret[0]) + getJustOffset(current));617 float y = getLineDrop(current) * line; 618 619 int x = (int) (getX() + caret[0] + 0.5) + getJustOffset(current); 619 620 x = Math 620 621 .min( 621 622 x, 622 623 (getX() - Item.MARGIN_RIGHT - (2 * getGravity()) + getBoundsWidth())); 623 return new Point(x, getY() + y + (int) caret[1]);624 return new Point(x, (int) (getY() + y + caret[1] + 0.5)); 624 625 } 625 626 … … 698 699 // move the cursor to the new location 699 700 float[] caret = current.getCaretInfo(hit); 700 int y = getLineDrop(current) * line;701 702 return new Point((int) (getX() + caret[0] ) + getJustOffset(current),703 getY() + y + (int) caret[1]);701 float y = getLineDrop(current) * line; 702 703 return new Point((int) (getX() + caret[0] + 0.5) 704 + getJustOffset(current), (int) (getY() + y + caret[1] + 0.5)); 704 705 } 705 706 … … 937 938 } 938 939 939 private int getLineDrop(TextLayout layout) {940 private float getLineDrop(TextLayout layout) { 940 941 if (getSpacing() < 0) 941 return (int) (layout.getAscent() + layout.getDescent() + layout942 .getLeading());943 944 return (int) (layout.getAscent() + layout.getDescent() + getSpacing());942 return layout.getAscent() + layout.getDescent() 943 + layout.getLeading(); 944 945 return layout.getAscent() + layout.getDescent() + getSpacing(); 945 946 } 946 947
Note:
See TracChangeset
for help on using the changeset viewer.