bounds.setValid(false);
return bounds;
}
Point blkPoint = block.getReferencePoint();
// Translate to origin and scale
bounds.setMaximumX((b.getMaximumX() - blkPoint.getX()) * scale_x);
bounds.setMinimumX((b.getMinimumX() - blkPoint.getX()) * scale_x);
bounds.setMaximumY((b.getMaximumY() - blkPoint.getY()) * scale_y);
bounds.setMinimumY((b.getMinimumY() - blkPoint.getY()) * scale_y);
// Rotate the Bounds
if (rotate != 0) {
Point p1 = rotatePoint(bounds.getMaximumX(), bounds.getMaximumY());
Point p2 = rotatePoint(bounds.getMaximumX(), bounds.getMinimumY());
Point p3 = rotatePoint(bounds.getMinimumX(), bounds.getMaximumY());
Point p4 = rotatePoint(bounds.getMinimumX(), bounds.getMinimumY());
// we have now 4 Points
// and we have to check all if they are the new maximum/minimum
// start with a empty bounds
bounds = new Bounds();