- Timestamp:
- 05/10/18 16:04:51 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/items/MagneticConstraint/Utilities/TextLogic.java
r963 r1102 1 1 package org.expeditee.items.MagneticConstraint.Utilities; 2 2 3 import org.expeditee.g ui.Browser;4 import org.expeditee.gui.Display IO;3 import org.expeditee.gio.EcosystemManager; 4 import org.expeditee.gui.DisplayController; 5 5 import org.expeditee.items.Text; 6 6 … … 9 9 public static boolean XIsTowardsRight(final int x, final Text text) { 10 10 if(text.getPixelBoundsUnion() == null) return false; 11 final double distanceThroughText = x - text.getPixelBoundsUnion().get X();11 final double distanceThroughText = x - text.getPixelBoundsUnion().getMinX(); 12 12 return /*text.getText().length() == 1 ||*/ distanceThroughText > (text.getPixelBoundsUnion().getWidth() / 2); 13 13 } … … 15 15 public static boolean XIsTowardsLeft(final Text text, final int x) { 16 16 if(text.getPixelBoundsUnion() == null) return false; 17 final double distanceThroughText = x - text.getPixelBoundsUnion().get X();17 final double distanceThroughText = x - text.getPixelBoundsUnion().getMinX(); 18 18 return distanceThroughText < (text.getPixelBoundsUnion().getWidth() / 2); 19 19 } … … 21 21 public static boolean XIsBeforeCharacters(final Text text, final int x) { 22 22 try { 23 final int firstLetterWidth = Browser._theBrowser.getFontMetrics(Browser._theBrowser.getFont()).stringWidth(text.getText().substring(0, 1));24 final double distanceThroughText = x - text.getPixelBoundsUnion().get X();23 final int firstLetterWidth = EcosystemManager.getTextLayoutManager().getStringWidth(null, text.getText().substring(0, 1)); 24 final double distanceThroughText = x - text.getPixelBoundsUnion().getMinX(); 25 25 return firstLetterWidth > distanceThroughText; 26 26 } catch (NullPointerException e) { … … 33 33 public static boolean XIsAfterCharacters(final Text text, final int x) { 34 34 try { 35 final double distanceThroughText = x - text.getPixelBoundsUnion().get X();35 final double distanceThroughText = x - text.getPixelBoundsUnion().getMinX(); 36 36 return distanceThroughText > text.getPixelBoundsUnion().getWidth(); 37 37 } catch (NullPointerException e) { … … 41 41 42 42 public static int GetInsertionIndexSelected(final Text text) { 43 return text.getCharPosition(0, Display IO.getMouseX()).getInsertionIndex();43 return text.getCharPosition(0, DisplayController.getMouseX()).getInsertionIndex(); 44 44 } 45 45 }
Note:
See TracChangeset
for help on using the changeset viewer.