From 6536bcd056d0754680dd667d012418258c061091 Mon Sep 17 00:00:00 2001 From: Alexander Gorbunov Date: Mon, 21 Feb 2022 02:58:15 +0700 Subject: [PATCH] Fix mouse wheel zooming in both directions on Mac --- bCNC/CNCCanvas.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bCNC/CNCCanvas.py b/bCNC/CNCCanvas.py index 849fa0aca..3ea20cfe7 100644 --- a/bCNC/CNCCanvas.py +++ b/bCNC/CNCCanvas.py @@ -1008,7 +1008,9 @@ def mouseZoomOut(self, event): # ---------------------------------------------------------------------- def wheel(self, event): - self.zoomCanvas(event.x, event.y, pow(ZOOM,(event.delta//120))) + scaledDelta = event.delta / 120 + deltaPower = math.ceil(scaledDelta) if scaledDelta > 0 else math.floor(scaledDelta) + self.zoomCanvas(event.x, event.y, pow(ZOOM, deltaPower)) # ---------------------------------------------------------------------- # Change the insert marker location