From aa559ccfaeb2b62a92b753868b72e7625ecf42b8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tobias=20Gl=C3=A4=C3=9Fer?= Date: Thu, 6 May 2004 16:50:30 +0000 Subject: [PATCH] Fixed bug where tiles/objects could be drawn while scrolling. SVN-Revision: 1008 --- src/leveleditor.cpp | 44 ++++++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/src/leveleditor.cpp b/src/leveleditor.cpp index 795d26b33..150c1831c 100644 --- a/src/leveleditor.cpp +++ b/src/leveleditor.cpp @@ -1362,11 +1362,8 @@ void le_checkevents() } } - if(!Menu::current()) + if(!Menu::current() && !show_minimap) { - le_move_left_bt->event(event); - le_move_right_bt->event(event); - if(le_mouse_pressed[LEFT]) { if(le_current.IsTile()) @@ -1393,28 +1390,43 @@ void le_checkevents() if(!Menu::current()) { show_minimap = false; - - if(le_move_left_bt->get_state() == BUTTON_PRESSED) + + le_move_left_bt->event(event); + le_move_right_bt->event(event); + switch(le_move_left_bt->get_state()) { + case BUTTON_PRESSED: pos_x -= 192; show_minimap = true; - } - else if(le_move_left_bt->get_state() == BUTTON_HOVER) - { + break; + case BUTTON_HOVER: pos_x -= 32; - show_minimap = true; + show_minimap = true; + break; + case BUTTON_CLICKED: + show_minimap = true; + break; + default: + break; } - if(le_move_right_bt->get_state() == BUTTON_PRESSED) + switch(le_move_right_bt->get_state()) { + case BUTTON_PRESSED: pos_x += 192; - show_minimap = true; - } - else if(le_move_right_bt->get_state() == BUTTON_HOVER) - { + show_minimap = true; + break; + case BUTTON_HOVER: pos_x += 32; - show_minimap = true; + show_minimap = true; + break; + case BUTTON_CLICKED: + show_minimap = true; + break; + default: + break; } + } } -- 2.11.0