Skip to content

Commit

Permalink
Run spotlessApply
Browse files Browse the repository at this point in the history
  • Loading branch information
mal-w committed Dec 27, 2023
1 parent 3a1744e commit dbb32f0
Showing 1 changed file with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ protected void paintBorder(
}

@Override
protected void paintArea(Graphics2D g, int x, int y, int xOff, int yOff, int gridSize, int distance) {
protected void paintArea(
Graphics2D g, int x, int y, int xOff, int yOff, int gridSize, int distance) {
// NO-OP, not used. I overrode AbstractTemplate#paint in this class and I don't call paintBorder
// and paintArea separately anymore.
}
Expand Down Expand Up @@ -230,31 +231,31 @@ public Area getArea() {
// that the boundingBox intersects.
Rectangle boundingBox = path.getBounds();
ZonePoint leftUpper =
new ZonePoint(
gridSize * (int) Math.floor(boundingBox.x / gridSize),
gridSize * (int) Math.floor(boundingBox.y / gridSize));
new ZonePoint(
gridSize * (int) Math.floor(boundingBox.x / gridSize),
gridSize * (int) Math.floor(boundingBox.y / gridSize));

float bottomRightX = boundingBox.x + boundingBox.width;
int bottomRightXSnapped = gridSize * (int) Math.ceil(bottomRightX / gridSize);
float bottomRightY = boundingBox.y + boundingBox.height;
int bottomRightYSnapped = gridSize * (int) Math.ceil(bottomRightY / gridSize);
ZonePoint bottomRight = new ZonePoint(bottomRightXSnapped, bottomRightYSnapped);
Rectangle gridSnappedBoundingBox =
new Rectangle(
leftUpper.x, leftUpper.y, bottomRight.x - leftUpper.x, bottomRight.y - leftUpper.y);
new Rectangle(
leftUpper.x, leftUpper.y, bottomRight.x - leftUpper.x, bottomRight.y - leftUpper.y);

Area cone = new Area(path);
Area aoe = new Area(); // Empty rectangle that we will update.
/** */
PriorityQueue<Rectangle> queue =
new PriorityQueue<Rectangle>(
new Comparator<Rectangle>() {
@Override
/** We prioritize smaller rectangles so the Queue stays smaller. */
public int compare(Rectangle o1, Rectangle o2) {
return o1.height * o1.width - o2.height * o2.width;
}
});
new PriorityQueue<Rectangle>(
new Comparator<Rectangle>() {
@Override
/** We prioritize smaller rectangles so the Queue stays smaller. */
public int compare(Rectangle o1, Rectangle o2) {
return o1.height * o1.width - o2.height * o2.width;
}
});
queue.add(gridSnappedBoundingBox);
while (queue.size() > 0) {
// if fully contained, then add it to the shape
Expand Down

0 comments on commit dbb32f0

Please sign in to comment.