From 72ca36535a4525863e64d1d83434294afb60e4e9 Mon Sep 17 00:00:00 2001 From: James Turner Date: Wed, 15 Nov 2017 17:02:25 +0000 Subject: [PATCH] Fix the PUI map ruler feature, use right-click MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The OSG Ctrl to right-click mapping was breaking this on Mac, but changing that will break other things, so move the ruler feature from ‘ctrl left click’ to a simple ‘right click’ which ends up being the same on Mac anyway. --- src/GUI/MapWidget.cxx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) 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)); - } } }