Sets the integer boundaries x, y, width, height from given sub-pixel boundaries, such that all points are within the integer bounding rectangle. For open line selections and (multi)Point Rois, note that integer Roi coordinates correspond to the center of the 1x1 rectangle enclosing a pixel. Poin
(Rectangle2D.Double bounds)
| 560 | * screen at high zoom levels. (For lines and points, it should include all |
| 561 | * pixels affected by 'draw' */ |
| 562 | void setIntBounds(Rectangle2D.Double bounds) { |
| 563 | if (useLineSubpixelConvention()) { //for PointRois & open lines, ensure the 'draw' area is enclosed |
| 564 | x = (int)Math.floor(bounds.x + 0.5); |
| 565 | y = (int)Math.floor(bounds.y + 0.5); |
| 566 | width = (int)Math.floor(bounds.x + bounds.width + 1.5) - x; |
| 567 | height = (int)Math.floor(bounds.y + bounds.height + 1.5) - y; |
| 568 | } else { //for area Rois, the subpixel bounds must be enclosed in the int bounds |
| 569 | x = (int)Math.floor(bounds.x); |
| 570 | y = (int)Math.floor(bounds.y); |
| 571 | width = (int)Math.ceil(bounds.x + bounds.width) - x; |
| 572 | height = (int)Math.ceil(bounds.y + bounds.height) - y; |
| 573 | } |
| 574 | } |
| 575 | |
| 576 | /** |
| 577 | * @deprecated |
no test coverage detected