fixed tile cursor in the map editor
@@ -1051,23 +1051,15 @@ static void drawMapReg(Map* map)
tic_mem* tic = map->tic;
tic_rect rect = {MAP_X, MAP_Y, MAP_WIDTH, MAP_HEIGHT};
- if(!sheetVisible(map) && checkMousePos(&rect))
- {
- if(tic_api_key(tic, tic_key_space))
- {
- processScrolling(map, checkMouseDown(&rect, tic_mouse_left) || checkMouseDown(&rect, tic_mouse_right));
- }
- else
- {
- static void(*const Handlers[])(Map*) = {processMouseDrawMode, processMouseDragMode, processMouseSelectMode, processMouseFillMode};
-
- Handlers[map->mode](map);
+ bool handle = !sheetVisible(map) && checkMousePos(&rect);
+ bool space = tic_api_key(tic, tic_key_space);
- if(map->mode != MAP_DRAG_MODE)
- processScrolling(map, checkMouseDown(&rect, tic_mouse_right));
- }
- }
+ if(handle)
+ processScrolling(map,
+ ((space || map->mode == MAP_DRAG_MODE) && checkMouseDown(&rect, tic_mouse_left)) ||
+ checkMouseDown(&rect, tic_mouse_right));
+ {
s32 scrollX = map->scroll.x % TIC_SPRITESIZE;
s32 scrollY = map->scroll.y % TIC_SPRITESIZE;
@@ -1082,6 +1074,13 @@ static void drawMapReg(Map* map)
drawGrid(map);
}
+ if(handle && !space)
+ {
+ static void(*const Handlers[])(Map*) = {processMouseDrawMode, processMouseDragMode, processMouseSelectMode, processMouseFillMode};
+ Handlers[map->mode](map);
+ }
+}
+
static void undo(Map* map)
{
history_undo(map->history);
@@ -1283,7 +1282,7 @@ static void overline(tic_mem* tic, void* data)
{
tic_rect rect = {MAP_X, MAP_Y, MAP_WIDTH, MAP_HEIGHT};
- if(!sheetVisible(map) && checkMousePos(&rect))
+ if(!sheetVisible(map) && checkMousePos(&rect) && !tic_api_key(tic, tic_key_space))
{
switch(map->mode)
{
