Fix 3dmouse navigation in 3d-viewer orthographic projection.

The zoom level was being incorrectly calculated. When zooming in on a
PCB, the zoom function can become disabled if you get too close. At
which point you need to use the mouse wheel to zoom back out.
This commit is contained in:
markus-bonk 2022-02-01 14:17:30 +01:00 committed by Wayne Stambaugh
parent e590d07224
commit 53cf899b67
1 changed files with 1 additions and 1 deletions

View File

@ -397,7 +397,7 @@ long NL_3D_VIEWER_PLUGIN_IMPL::SetViewExtents( const navlib::box_t& extents )
{ {
const CAMERA_FRUSTUM& f = m_camera->GetFrustum(); const CAMERA_FRUSTUM& f = m_camera->GetFrustum();
float factor = 2 * f.nw / ( extents.max_x - extents.min_x ); float factor = f.nw / ( extents.max_x - extents.min_x );
float zoom = m_camera->GetZoom() / factor; float zoom = m_camera->GetZoom() / factor;
m_camera->Zoom( factor ); m_camera->Zoom( factor );