- Timestamp:
- 04/23/14 11:09:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/items/Text.java
r906 r909 1337 1337 } 1338 1338 1339 @Override1340 public boolean intersects (Polygon p) {1339 //@Override 1340 public boolean intersectsOLD(Polygon p) { 1341 1341 if (super.intersects(p)) { 1342 1342 float textY = getY(); … … 1356 1356 } 1357 1357 } 1358 return false; 1359 } 1360 1361 // The following version of intersect uses a tighter definition for the text, based on 1362 @Override 1363 public boolean intersects(Polygon p) { 1364 if (super.intersects(p)) { 1365 float textY = getY(); 1366 1367 for (TextLayout text : _textLayouts) { 1368 1369 Rectangle text_pixel_bounds_rect = this.getPixelBounds(text); 1370 1371 if (p.intersects(text_pixel_bounds_rect)) { 1372 return true; 1373 } 1374 } 1375 } 1376 1358 1377 return false; 1359 1378 } … … 1856 1875 int ldx = 1+getX()+getJustOffset(layout); // Layout draw x 1857 1876 1858 boolean debug = false;1877 boolean debug = true; 1859 1878 if (debug) { 1860 1879 g.setColor(new Color(c.getRed(),c.getGreen(),c.getBlue(),40)); … … 2614 2633 2615 2634 2635 protected Rectangle getPixelBounds(TextLayout layout) 2636 { 2637 // Does 'layout' need to be synchronized (similar to _textLayouts below)?? 2638 int x = getX(); 2639 int y = getY(); 2640 2641 int ldx = 1+x+getJustOffset(layout); // Layout draw x 2642 Rectangle layout_rect = layout.getPixelBounds(null, ldx, y); 2643 2644 return layout_rect; 2645 } 2646 2616 2647 2617 2648 public Rectangle getPixelBoundsUnion()
Note:
See TracChangeset
for help on using the changeset viewer.