Fixed bug where we scrolled in textbox and on map at the same time. (Bug #6334)

This commit is contained in:
Danny Daemonic 2006-08-28 22:16:05 +00:00
parent 0798bddeef
commit 1689a252ef

View file

@ -603,22 +603,22 @@ void play_controller::play_slice()
const int scroll_threshold = (preferences::mouse_scroll_enabled()) ? 5 : 0;
bool scrolling = false;
if(key[SDLK_UP] || mousey < scroll_threshold) {
if((key[SDLK_UP] && !menu_handler_.get_textbox().active()) || mousey < scroll_threshold) {
gui_->scroll(0,-preferences::scroll_speed());
scrolling = true;
}
if(key[SDLK_DOWN] || mousey > gui_->y()-scroll_threshold) {
if((key[SDLK_DOWN] && !menu_handler_.get_textbox().active()) || mousey > gui_->y()-scroll_threshold) {
gui_->scroll(0,preferences::scroll_speed());
scrolling = true;
}
if(key[SDLK_LEFT] || mousex < scroll_threshold) {
if((key[SDLK_LEFT] && !menu_handler_.get_textbox().active()) || mousex < scroll_threshold) {
gui_->scroll(-preferences::scroll_speed(),0);
scrolling = true;
}
if(key[SDLK_RIGHT] || mousex > gui_->x()-scroll_threshold) {
if((key[SDLK_RIGHT] && !menu_handler_.get_textbox().active()) || mousex > gui_->x()-scroll_threshold) {
gui_->scroll(preferences::scroll_speed(),0);
scrolling = true;
}