Skip to content

Commit

Permalink
#5753: Sign of the X argument in scrollByPixels is inversed now, adju…
Browse files Browse the repository at this point in the history
…st that
  • Loading branch information
codereader committed Oct 1, 2021
1 parent a997c1b commit 834dab9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions radiant/xyview/XYWnd.cpp
Expand Up @@ -1576,12 +1576,13 @@ void XYWnd::zoomIn()
setScale( getZoomedScale( 1 ) );
}

void XYWnd::zoomInOn( wxPoint cursor, int zoom ) {
void XYWnd::zoomInOn(wxPoint cursor, int zoom)
{
const float oldScale = _scale;
const float newScale = getZoomedScale( zoom );
scrollByPixels( cursor.x - _width/2, _height / 2 - cursor.y );
setScale( newScale );
scrollByPixels( ( _width / 2 - cursor.x ) * oldScale / newScale, ( cursor.y - _height / 2 ) * oldScale / newScale );
const float newScale = getZoomedScale(zoom);
scrollByPixels(_width / 2 - cursor.x, _height / 2 - cursor.y);
setScale(newScale);
scrollByPixels((cursor.x - _width / 2) * oldScale / newScale, (cursor.y - _height / 2) * oldScale / newScale);
}

// ================ CALLBACKS ======================================
Expand Down

0 comments on commit 834dab9

Please sign in to comment.