Skip to content

Commit 0e2553f

Browse files
committed
Fix minor issues
1 parent 96873e8 commit 0e2553f

File tree

1 file changed

+4
-4
lines changed
  • weasis-dicom/weasis-dicom-viewer2d/src/main/java/org/weasis/dicom/viewer2d/mpr

1 file changed

+4
-4
lines changed

weasis-dicom/weasis-dicom-viewer2d/src/main/java/org/weasis/dicom/viewer2d/mpr/AxisDirection.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ public Color getDirectionColor(Vector3d direction) {
9393
int g = (int) (weightX * x.getGreen() + weightY * y.getGreen() + weightZ * z.getGreen());
9494
int b = (int) (weightX * x.getBlue() + weightY * y.getBlue() + weightZ * z.getBlue());
9595

96-
r = Math.min(255, Math.max(0, r));
97-
g = Math.min(255, Math.max(0, g));
98-
b = Math.min(255, Math.max(0, b));
96+
r = Math.clamp(r, 0, 255);
97+
g = Math.clamp(g, 0, 255);
98+
b = Math.clamp(b, 0, 255);
9999
return new Color(r, g, b);
100100
}
101101

@@ -183,7 +183,7 @@ private void drawAxisLine(Graphics2D g2d, Vector3d arrow, Point offset) {
183183
int y1 = offset.y;
184184
int x2 = offset.x + (int) arrow.x;
185185
int y2 = offset.y + (int) arrow.y;
186-
double distance = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
186+
double distance = Math.sqrt(Math.pow((double) x2 - x1, 2) + Math.pow((double) y2 - y1, 2));
187187
if (distance >= 10.0) {
188188
g2d.drawLine(x1, y1, x2, y2);
189189
drawArrowHead(g2d, x2, y2, x1, y1);

0 commit comments

Comments
 (0)