Skip to content

Commit

Permalink
Draw target feedback box with graphics line width calculation
Browse files Browse the repository at this point in the history
- Use the same method to draw the outline of figures
  • Loading branch information
Phillipus committed Feb 18, 2024
1 parent ad24769 commit 26c0fb9
Showing 1 changed file with 3 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,21 +112,11 @@ protected void drawTargetFeedback(Graphics graphics) {
}

Rectangle bounds = getBounds().getCopy();
bounds.width--;
bounds.height--;

// Scaling
double scale = FigureUtils.getFigureScale(this);
if(scale == 1.5) {
bounds.width--;
bounds.height--;
}
else if(scale < 1) {
bounds.width -= 2;
bounds.height -= 2;
}

bounds.shrink(1, 1);
graphics.setForegroundColor(ColorConstants.blue);
graphics.setLineWidth(2);
setLineWidth(graphics, 2, bounds);
graphics.drawRectangle(bounds);

graphics.popState();
Expand Down

0 comments on commit 26c0fb9

Please sign in to comment.