diff --git a/src/GUI/MapWidget.cxx b/src/GUI/MapWidget.cxx index 90e9f868b..e28df0e21 100644 --- a/src/GUI/MapWidget.cxx +++ b/src/GUI/MapWidget.cxx @@ -512,27 +512,26 @@ void MapWidget::doHit( int button, int updown, int x, int y ) handlePan(x, y); return; } - + if (button == 3) { // mouse-wheel up zoomIn(); } else if (button == 4) { // mouse-wheel down zoomOut(); } - + + _hitLocation = SGVec2d(x - abox.min[0], y - abox.min[1]); + if ((button == 2) && (updown == PU_DOWN)) { + _clickGeod = unproject(_hitLocation - SGVec2d(_width>>1, _height>>1)); + } + if (button != active_mouse_button) { return; } - - _hitLocation = SGVec2d(x - abox.min[0], y - abox.min[1]); - + if (updown == PU_UP) { puDeactivateWidget(); } else if (updown == PU_DOWN) { puSetActiveWidget(this, x, y); - - if (fgGetKeyModifiers() & KEYMOD_CTRL) { - _clickGeod = unproject(_hitLocation - SGVec2d(_width>>1, _height>>1)); - } } }