From 601efc61224b2a7fdc50efb622519fb89acb08d6 Mon Sep 17 00:00:00 2001 From: Ad5001 Date: Mon, 16 Sep 2024 23:52:42 +0200 Subject: [PATCH] Fixing issue with LocationPickOverlay snap to grid. --- .../eu/ad5001/LogarithmPlotter/PickLocationOverlay.qml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/PickLocationOverlay.qml b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/PickLocationOverlay.qml index d8a6ac3..0139c5b 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/PickLocationOverlay.qml +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/PickLocationOverlay.qml @@ -282,10 +282,9 @@ Item { x: picker.mouseX - width - 5 y: picker.mouseY - height - 5 color: 'black' - property double axisX: Modules.Canvas.axesStep.x.value - property double axisY: Modules.Canvas.axesStep.y.value property double mouseX: { - let xpos = Modules.Canvas.px2x(picker.mouseX) + const axisX = Modules.Canvas.axesSteps.x.value + const xpos = Modules.Canvas.px2x(picker.mouseX) if(snapToGridCheckbox.checked) { if(canvas.logscalex) { // Calculate the logged power @@ -299,7 +298,8 @@ Item { } } property double mouseY: { - let ypos = Modules.Canvas.px2y(picker.mouseY) + const axisY = Modules.Canvas.axesSteps.y.value + const ypos = Modules.Canvas.px2y(picker.mouseY) if(snapToGridCheckbox.checked) { return axisY*Math.round(ypos/axisY) } else {