Skip to content

Commit 1eb797f

Browse files
committed
fix: Better zoom zone double computation
1 parent a416731 commit 1eb797f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fireplace-swing/src/main/java/io/github/bric3/fireplace/flamegraph/FlamegraphView.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,8 +1109,8 @@ private void paintMinimap(@NotNull Graphics g, @NotNull Rectangle visibleRect) {
11091109

11101110
{
11111111
// Zoom zone
1112-
double zoomZoneScaleX = (double) minimapBounds.width / flamegraphDimension.width;
1113-
double zoomZoneScaleY = (double) minimapBounds.height / flamegraphDimension.height;
1112+
double zoomZoneScaleX = ((double) minimapBounds.width) / ((double) flamegraphDimension.width);
1113+
double zoomZoneScaleY = ((double) minimapBounds.height) / ((double) flamegraphDimension.height);
11141114

11151115
int x = (int) (visibleRect.x * zoomZoneScaleX);
11161116
int y = (int) (visibleRect.y * zoomZoneScaleY);

0 commit comments

Comments
 (0)