From 1eb797f42f947b513f51ca65962210df2af158af Mon Sep 17 00:00:00 2001 From: Brice Dutheil Date: Mon, 25 Mar 2024 00:49:20 +0100 Subject: [PATCH] fix: Better zoom zone double computation --- .../io/github/bric3/fireplace/flamegraph/FlamegraphView.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fireplace-swing/src/main/java/io/github/bric3/fireplace/flamegraph/FlamegraphView.java b/fireplace-swing/src/main/java/io/github/bric3/fireplace/flamegraph/FlamegraphView.java index e76ef78..523785f 100644 --- a/fireplace-swing/src/main/java/io/github/bric3/fireplace/flamegraph/FlamegraphView.java +++ b/fireplace-swing/src/main/java/io/github/bric3/fireplace/flamegraph/FlamegraphView.java @@ -1109,8 +1109,8 @@ private void paintMinimap(@NotNull Graphics g, @NotNull Rectangle visibleRect) { { // Zoom zone - double zoomZoneScaleX = (double) minimapBounds.width / flamegraphDimension.width; - double zoomZoneScaleY = (double) minimapBounds.height / flamegraphDimension.height; + double zoomZoneScaleX = ((double) minimapBounds.width) / ((double) flamegraphDimension.width); + double zoomZoneScaleY = ((double) minimapBounds.height) / ((double) flamegraphDimension.height); int x = (int) (visibleRect.x * zoomZoneScaleX); int y = (int) (visibleRect.y * zoomZoneScaleY);