From c558c49bb5b229d936cf00b656ba49787e8fa783 Mon Sep 17 00:00:00 2001 From: codereader Date: Mon, 1 Nov 2021 05:38:14 +0100 Subject: [PATCH] #5792: Add logging output to XYWnd scrolling methods --- radiant/xyview/XYWnd.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/radiant/xyview/XYWnd.cpp b/radiant/xyview/XYWnd.cpp index 13f8231140..5a20b13fd9 100644 --- a/radiant/xyview/XYWnd.cpp +++ b/radiant/xyview/XYWnd.cpp @@ -171,7 +171,9 @@ void XYWnd::destroyXYView() _wxGLWidget = nullptr; } -void XYWnd::setScale(float f) { +void XYWnd::setScale(float f) +{ + rMessage() << "Setting scale to " << f << " (previous was " << _scale << ")" << std::endl; _scale = f; updateProjection(); updateModelview(); @@ -1577,7 +1579,6 @@ void XYWnd::zoomIn() void XYWnd::zoomInOn(wxPoint cursor, int zoom) { - const float oldScale = _scale; const float newScale = getZoomedScale(zoom); scrollByPixels(_width / 2 - cursor.x, _height / 2 - cursor.y); setScale(newScale); @@ -1633,16 +1634,19 @@ void XYWnd::onGLWindowScroll(wxMouseEvent& ev) { if (!ev.ShiftDown()) { + rMessage() << "Received GL Window Scroll" << std::endl; zoomInOn(ev.GetPosition(), ev.GetWheelRotation() > 0 ? 1 : -1); return; } if (ev.GetWheelRotation() > 0) { + rMessage() << "Received SHIFT + ZoomIn" << std::endl; zoomIn(); } else if (ev.GetWheelRotation() < 0) { + rMessage() << "Received SHIFT + ZoomOut" << std::endl; zoomOut(); } }