Changeset 17581 in josm for trunk/src/org
- Timestamp:
- 2021-03-17T22:15:55+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MapViewState.java
r17333 r17581 559 559 */ 560 560 public int getOutsideRectangleFlags(MapViewRectangle rect) { 561 Rectangle2D bounds = rect.getInView();562 561 int flags = 0; 563 if (getInViewX() < bounds.getMinX()) { 562 double inViewX = getInViewX(); 563 if (inViewX < rect.getInViewMinX()) { 564 564 flags |= OUTSIDE_LEFT; 565 } else if ( getInViewX() > bounds.getMaxX()) {565 } else if (inViewX > rect.getInViewMaxX()) { 566 566 flags |= OUTSIDE_RIGHT; 567 567 } 568 if (getInViewY() < bounds.getMinY()) { 568 double inViewY = getInViewY(); 569 if (inViewY < rect.getInViewMinY()) { 569 570 flags |= OUTSIDE_TOP; 570 } else if ( getInViewY() > bounds.getMaxY()) {571 } else if (inViewY > rect.getInViewMaxY()) { 571 572 flags |= OUTSIDE_BOTTOM; 572 573 } … … 734 735 double y2 = p2.getInViewY(); 735 736 return new Rectangle2D.Double(Math.min(x1, x2), Math.min(y1, y2), Math.abs(x1 - x2), Math.abs(y1 - y2)); 737 } 738 739 double getInViewMinX() { 740 return Math.min(p1.getInViewX(), p2.getInViewX()); 741 } 742 743 double getInViewMaxX() { 744 return Math.max(p1.getInViewX(), p2.getInViewX()); 745 } 746 747 double getInViewMinY() { 748 return Math.min(p1.getInViewY(), p2.getInViewY()); 749 } 750 751 double getInViewMaxY() { 752 return Math.max(p1.getInViewY(), p2.getInViewY()); 736 753 } 737 754
Note:
See TracChangeset
for help on using the changeset viewer.