From 53cf899b67356db84892be29141f49c311dacf93 Mon Sep 17 00:00:00 2001 From: markus-bonk Date: Tue, 1 Feb 2022 14:17:30 +0100 Subject: [PATCH] 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. --- 3d-viewer/3d_navlib/nl_3d_viewer_plugin_impl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3d-viewer/3d_navlib/nl_3d_viewer_plugin_impl.cpp b/3d-viewer/3d_navlib/nl_3d_viewer_plugin_impl.cpp index c43b78229d..ebe967278c 100644 --- a/3d-viewer/3d_navlib/nl_3d_viewer_plugin_impl.cpp +++ b/3d-viewer/3d_navlib/nl_3d_viewer_plugin_impl.cpp @@ -397,7 +397,7 @@ long NL_3D_VIEWER_PLUGIN_IMPL::SetViewExtents( const navlib::box_t& extents ) { 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; m_camera->Zoom( factor );