Sets the bounds of rectangular, oval or text selections. Note that for these types, subpixel resolution is ignored, and the x,y values are rounded down, the width and height values rounded up. Do not use for other ROI types since their width and height are results of a calculation. For translat
(Rectangle2D.Double b)
| 541 | * a calculation. |
| 542 | * For translating ROIs, use setLocation. */ |
| 543 | public void setBounds(Rectangle2D.Double b) { |
| 544 | if (!(type==RECTANGLE||type==OVAL||(this instanceof TextRoi))) |
| 545 | return; |
| 546 | this.x = (int)b.x; |
| 547 | this.y = (int)b.y; |
| 548 | this.width = (int)Math.ceil(b.width); |
| 549 | this.height = (int)Math.ceil(b.height); |
| 550 | bounds = new Rectangle2D.Double(b.x, b.y, b.width, b.height); |
| 551 | cachedMask = null; |
| 552 | } |
| 553 | |
| 554 | /** Sets the integer boundaries x, y, width, height from given sub-pixel |
| 555 | * boundaries, such that all points are within the integer bounding rectangle. |
no outgoing calls
no test coverage detected