Skip to content

Commit

Permalink
#5792: Add logging output to XYWnd scrolling methods
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Nov 1, 2021
1 parent 3cdb2cb commit c558c49
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions radiant/xyview/XYWnd.cpp
Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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();
}
}
Expand Down

0 comments on commit c558c49

Please sign in to comment.