Skip to content

Commit

Permalink
Fix minor issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nroduit committed Feb 3, 2025
1 parent 96873e8 commit 0e2553f
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ public Color getDirectionColor(Vector3d direction) {
int g = (int) (weightX * x.getGreen() + weightY * y.getGreen() + weightZ * z.getGreen());
int b = (int) (weightX * x.getBlue() + weightY * y.getBlue() + weightZ * z.getBlue());

r = Math.min(255, Math.max(0, r));
g = Math.min(255, Math.max(0, g));
b = Math.min(255, Math.max(0, b));
r = Math.clamp(r, 0, 255);
g = Math.clamp(g, 0, 255);
b = Math.clamp(b, 0, 255);
return new Color(r, g, b);
}

Expand Down Expand Up @@ -183,7 +183,7 @@ private void drawAxisLine(Graphics2D g2d, Vector3d arrow, Point offset) {
int y1 = offset.y;
int x2 = offset.x + (int) arrow.x;
int y2 = offset.y + (int) arrow.y;
double distance = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
double distance = Math.sqrt(Math.pow((double) x2 - x1, 2) + Math.pow((double) y2 - y1, 2));
if (distance >= 10.0) {
g2d.drawLine(x1, y1, x2, y2);
drawArrowHead(g2d, x2, y2, x1, y1);
Expand Down

0 comments on commit 0e2553f

Please sign in to comment.