From b7b663ddb5737ecc06251b9a1a72921b545487ae Mon Sep 17 00:00:00 2001 From: Sander Schobers Date: Sat, 23 May 2020 10:43:05 +0200 Subject: [PATCH] Fixed bug where mouse was released outside terrain area when dragging it kept dragging. --- terrainrenderer.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/terrainrenderer.go b/terrainrenderer.go index 82e7039..ede0654 100644 --- a/terrainrenderer.go +++ b/terrainrenderer.go @@ -63,12 +63,9 @@ func (r *terrainRenderer) Handle(ctx ui.Context, event ui.Event) bool { } } case *ui.MouseButtonUpEvent: - pos := e.Pos() - if pos.In(r.interactBounds) { - if _, ok := r.drag.IsDragging(); ok { - r.game.Terrain.Center = r.isometric.TileInt(r.isometric.Center()) - r.drag.Cancel() - } + if _, ok := r.drag.IsDragging(); ok { + r.game.Terrain.Center = r.isometric.TileInt(r.isometric.Center()) + r.drag.Cancel() } case *ui.MouseMoveEvent: pos := e.Pos()