public Rectangle2D getBounds2D() { float rx1 = Math.min(Math.min(x1, x2), Math.min(ctrlx1, ctrlx2)); float ry1 = Math.min(Math.min(y1, y2), Math.min(ctrly1, ctrly2)); float rx2 = Math.max(Math.max(x1, x2), Math.max(ctrlx1, ctrlx2)); float ry2 = Math.max(Math.max(y1, y2), Math.max(ctrly1, ctrly2)); return new Rectangle2D.Float(rx1, ry1, rx2 - rx1, ry2 - ry1); } }
public Rectangle2D getBounds2D() { float rx1 = Math.min(Math.min(x1, x2), Math.min(ctrlx1, ctrlx2)); float ry1 = Math.min(Math.min(y1, y2), Math.min(ctrly1, ctrly2)); float rx2 = Math.max(Math.max(x1, x2), Math.max(ctrlx1, ctrlx2)); float ry2 = Math.max(Math.max(y1, y2), Math.max(ctrly1, ctrly2)); return new Rectangle2D.Float(rx1, ry1, rx2 - rx1, ry2 - ry1); } }
public Rectangle2D getBounds2D() { float rx0 = Math.min(Math.min(x1, x2), ctrlx); float ry0 = Math.min(Math.min(y1, y2), ctrly); float rx1 = Math.max(Math.max(x1, x2), ctrlx); float ry1 = Math.max(Math.max(y1, y2), ctrly); return new Rectangle2D.Float(rx0, ry0, rx1 - rx0, ry1 - ry0); } }
public Rectangle2D getBounds2D() { float rx1, ry1, rx2, ry2; if (pointSize == 0) { rx1 = ry1 = rx2 = ry2 = 0.0f; } else { int i = pointSize - 1; ry1 = ry2 = points[i--]; rx1 = rx2 = points[i--]; while (i > 0) { float y = points[i--]; float x = points[i--]; if (x < rx1) { rx1 = x; } else if (x > rx2) { rx2 = x; } if (y < ry1) { ry1 = y; } else if (y > ry2) { ry2 = y; } } } return new Rectangle2D.Float(rx1, ry1, rx2 - rx1, ry2 - ry1); }
public Rectangle2D getBounds2D() { float rx1, ry1, rx2, ry2; if (pointSize == 0) { rx1 = ry1 = rx2 = ry2 = 0.0f; } else { int i = pointSize - 1; ry1 = ry2 = points[i--]; rx1 = rx2 = points[i--]; while (i > 0) { float y = points[i--]; float x = points[i--]; if (x < rx1) { rx1 = x; } else if (x > rx2) { rx2 = x; } if (y < ry1) { ry1 = y; } else if (y > ry2) { ry2 = y; } } } return new Rectangle2D.Float(rx1, ry1, rx2 - rx1, ry2 - ry1); }
public Rectangle2D getBounds2D() { float rx, ry, rw, rh; if (x1 < x2) { rx = x1; rw = x2 - x1; } else { rx = x2; rw = x1 - x2; } if (y1 < y2) { ry = y1; rh = y2 - y1; } else { ry = y2; rh = y1 - y2; } return new Rectangle2D.Float(rx, ry, rw, rh); } }
public Rectangle2D getBounds2D() { float rx, ry, rw, rh; if (x1 < x2) { rx = x1; rw = x2 - x1; } else { rx = x2; rw = x1 - x2; } if (y1 < y2) { ry = y1; rh = y2 - y1; } else { ry = y2; rh = y1 - y2; } return new Rectangle2D.Float(rx, ry, rw, rh); } }
/** * Computes the bounding rectangle for this line segment. The rectangle has a rotation 0 degrees * with respect to the coordinate system that the line system is in. For example, if a line segment * is 5 unit long and sits at a 37 degree angle from horizontal, the bounding rectangle will have * origin of the lower left hand end point of the segment, with width = 4 and height = 3. * @return the bounding rectangle * @since 5.0.2 */ public Rectangle2D.Float getBoundingRectange(){ float x1 = getStartPoint().get(Vector.I1); float y1 = getStartPoint().get(Vector.I2); float x2 = getEndPoint().get(Vector.I1); float y2 = getEndPoint().get(Vector.I2); return new Rectangle2D.Float(Math.min(x1, x2), Math.min(y1, y2), Math.abs(x2-x1), Math.abs(y2-y1)); }
/** * Computes the bounding rectangle for this line segment. The rectangle has a rotation 0 degrees * with respect to the coordinate system that the line system is in. For example, if a line segment * is 5 unit long and sits at a 37 degree angle from horizontal, the bounding rectangle will have * origin of the lower left hand end point of the segment, with width = 4 and height = 3. * @return the bounding rectangle * @since 5.0.2 */ public Rectangle2D.Float getBoundingRectange(){ float x1 = getStartPoint().get(Vector.I1); float y1 = getStartPoint().get(Vector.I2); float x2 = getEndPoint().get(Vector.I1); float y2 = getEndPoint().get(Vector.I2); return new Rectangle2D.Float(Math.min(x1, x2), Math.min(y1, y2), Math.abs(x2-x1), Math.abs(y2-y1)); }
@Override public Rectangle2D createIntersection(Rectangle2D r) { Rectangle2D dst; if (r instanceof Double) { dst = new Rectangle2D.Double(); } else { dst = new Rectangle2D.Float(); } Rectangle2D.intersect(this, r, dst); return dst; }
@Override public Rectangle2D createUnion(Rectangle2D r) { Rectangle2D dst; if (r instanceof Double) { dst = new Rectangle2D.Double(); } else { dst = new Rectangle2D.Float(); } Rectangle2D.union(this, r, dst); return dst; }
@Override public Rectangle2D getBounds2D() { return new Float(x, y, width, height); }
@Override public Rectangle2D getBounds2D() { return new Float(x, y, width, height); }
public Rectangle2D getBounds2D() { float rx0 = Math.min(Math.min(x1, x2), ctrlx); float ry0 = Math.min(Math.min(y1, y2), ctrly); float rx1 = Math.max(Math.max(x1, x2), ctrlx); float ry1 = Math.max(Math.max(y1, y2), ctrly); return new Rectangle2D.Float(rx0, ry0, rx1 - rx0, ry1 - ry0); } }
@Override public Rectangle2D createIntersection(Rectangle2D r) { Rectangle2D dst; if (r instanceof Double) { dst = new Rectangle2D.Double(); } else { dst = new Rectangle2D.Float(); } Rectangle2D.intersect(this, r, dst); return dst; }
@Override public Rectangle2D createUnion(Rectangle2D r) { Rectangle2D dst; if (r instanceof Double) { dst = new Rectangle2D.Double(); } else { dst = new Rectangle2D.Float(); } Rectangle2D.union(this, r, dst); return dst; }