diff --git a/terrainrenderer.go b/terrainrenderer.go index ea35496..cfd3837 100644 --- a/terrainrenderer.go +++ b/terrainrenderer.go @@ -42,12 +42,13 @@ func (r *terrainRenderer) Handle(ctx *Context, event sdl.Event) bool { case *sdl.MouseButtonEvent: if r.project.windowInteractRect.IsPointInside(e.X, e.Y) { if e.Type == sdl.MOUSEBUTTONDOWN { - if e.Button == sdl.BUTTON_MIDDLE || (e.Button == sdl.BUTTON_LEFT && isControlKeyDown()) { + controlKeyDown := isControlKeyDown() + if e.Button == sdl.BUTTON_MIDDLE || (e.Button == sdl.BUTTON_LEFT && controlKeyDown) { if !r.drag.IsDragging() { r.drag.Start(Pt(e.X, e.Y)) } } - if e.Button == sdl.BUTTON_LEFT { + if e.Button == sdl.BUTTON_LEFT && !controlKeyDown { pos := r.project.screenToMapInt(e.X, e.Y) r.game.UserClickedTile(pos) }