From b4b1f4d1a89fe0c8554ce0ad21e1956621b8e90f Mon Sep 17 00:00:00 2001 From: def Date: Fri, 22 Aug 2014 15:40:23 +0200 Subject: [PATCH] fix tileset selection --- src/game/editor/editor.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/game/editor/editor.cpp b/src/game/editor/editor.cpp index cb2481a5d..73abe8959 100644 --- a/src/game/editor/editor.cpp +++ b/src/game/editor/editor.cpp @@ -1807,6 +1807,8 @@ void CEditor::DoMapEditor(CUIRect View, CUIRect ToolBar) // fetch mouse position float wx = UI()->MouseWorldX(); float wy = UI()->MouseWorldY(); + float mx = UI()->MouseX(); + float my = UI()->MouseY(); static float s_StartWx = 0; static float s_StartWy = 0; @@ -1830,6 +1832,8 @@ void CEditor::DoMapEditor(CUIRect View, CUIRect ToolBar) float h = Size*(Screen.h/View.h); float x = -(View.x/Screen.w)*w; float y = -(View.y/Screen.h)*h; + wx = x+w*mx/Screen.w; + wy = y+h*my/Screen.h; CLayerTiles *t = (CLayerTiles *)GetSelectedLayerType(0, LAYERTYPE_TILES); if(t) {