From b85f4e404ddda36a716ac7181a9d7608ffa03576 Mon Sep 17 00:00:00 2001 From: Sander Schobers Date: Mon, 18 May 2020 11:39:27 +0200 Subject: [PATCH] Fixed handling of mouse wheel for zooming the terrain. --- terrainrenderer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/terrainrenderer.go b/terrainrenderer.go index 9d7be29..c48cb43 100644 --- a/terrainrenderer.go +++ b/terrainrenderer.go @@ -85,9 +85,9 @@ func (r *terrainRenderer) Handle(ctx ui.Context, event ui.Event) bool { r.project.update(ctx.Renderer()) } if r.hover != nil { - if e.Y < 0 { + if e.MouseWheel < 0 { r.project.ZoomOut(ctx, r.hover.ToF32()) - } else { + } else if e.MouseWheel > 0 { r.project.ZoomIn(ctx, r.hover.ToF32()) } }