diff --git a/radiant/xyview/XYWnd.cpp b/radiant/xyview/XYWnd.cpp index 53f8f33d4a..710da78b7b 100644 --- a/radiant/xyview/XYWnd.cpp +++ b/radiant/xyview/XYWnd.cpp @@ -1546,17 +1546,23 @@ void XYWnd::mouseToPoint(int x, int y, Vector3& point) // NOTE: the zoom out factor is 4/5, we could think about customizing it // we don't go below a zoom factor corresponding to 10% of the max world size // (this has to be computed against the window size) -float XYWnd::getZoomedScale( int steps ) { - const float min_scale = std::min( getWidth(), getHeight() ) / ( 1.1f * ( _maxWorldCoord - _minWorldCoord ) ); +float XYWnd::getZoomedScale(int steps) +{ + const float min_scale = std::min(getWidth(), getHeight()) / (1.1f * (_maxWorldCoord - _minWorldCoord)); const float max_scale = GlobalXYWnd().maxZoomFactor(); - const float fZoom = pow( 5.0f / 4.0f, steps ); + const float fZoom = pow(5.0f / 4.0f, steps); const float scale = getScale() * fZoom; - if ( scale > max_scale ) { + + if (scale > max_scale) + { return max_scale; } - if ( scale < min_scale ) { + + if (scale < min_scale) + { return min_scale; } + return scale; } diff --git a/radiant/xyview/XYWnd.h b/radiant/xyview/XYWnd.h index 0b717c5c62..30415c0cd8 100644 --- a/radiant/xyview/XYWnd.h +++ b/radiant/xyview/XYWnd.h @@ -133,7 +133,6 @@ class XYWnd : void mouseToPoint(int x, int y, Vector3& point); - float getZoomedScale( int steps ); void zoomIn() override; void zoomOut() override; void zoomInOn( wxPoint cursor, int zoom ); @@ -179,6 +178,7 @@ class XYWnd : void onContextMenu(); void drawSizeInfo(int nDim1, int nDim2, const Vector3& vMinBounds, const Vector3& vMaxBounds); void drawCameraIcon(); + float getZoomedScale(int steps); // callbacks bool checkChaseMouse(unsigned int state);