From 4d84bee6f64bc7754a1e57268c7ab9fbf3a13aa3 Mon Sep 17 00:00:00 2001 From: Josue Huaroto Date: Fri, 1 Sep 2023 17:51:50 +0000 Subject: [PATCH] Add Zoom level to the 3D viewer in PCB --- 3d-viewer/3d_canvas/eda_3d_canvas.cpp | 3 +++ 3d-viewer/3d_viewer/eda_3d_viewer_frame.cpp | 2 +- 3d-viewer/3d_viewer/eda_3d_viewer_frame.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/3d-viewer/3d_canvas/eda_3d_canvas.cpp b/3d-viewer/3d_canvas/eda_3d_canvas.cpp index d3a5c39045..925d2c1538 100644 --- a/3d-viewer/3d_canvas/eda_3d_canvas.cpp +++ b/3d-viewer/3d_canvas/eda_3d_canvas.cpp @@ -330,6 +330,9 @@ void EDA_3D_CANVAS::DisplayStatus() msg.Printf( wxT( "dy %3.2f" ), m_camera.GetCameraPos().y ); m_parentStatusBar->SetStatusText( msg, static_cast( EDA_3D_VIEWER_STATUSBAR::Y_POS ) ); + + msg.Printf( wxT( "zoom %3.2f" ), 1 / m_camera.GetZoom() ); + m_parentStatusBar->SetStatusText( msg, static_cast( EDA_3D_VIEWER_STATUSBAR::ZOOM_LEVEL ) ); } } diff --git a/3d-viewer/3d_viewer/eda_3d_viewer_frame.cpp b/3d-viewer/3d_viewer/eda_3d_viewer_frame.cpp index a054739b67..acf048b2a5 100644 --- a/3d-viewer/3d_viewer/eda_3d_viewer_frame.cpp +++ b/3d-viewer/3d_viewer/eda_3d_viewer_frame.cpp @@ -106,7 +106,7 @@ EDA_3D_VIEWER_FRAME::EDA_3D_VIEWER_FRAME( KIWAY* aKiway, PCB_BASE_FRAME* aParent SetIcon( icon ); // Create the status line - static const int status_dims[4] = { -1, 170, 130, 130 }; + static const int status_dims[5] = { -1, 170, 130, 130, 130 }; wxStatusBar *status_bar = CreateStatusBar( arrayDim( status_dims ) ); SetStatusWidths( arrayDim( status_dims ), status_dims ); diff --git a/3d-viewer/3d_viewer/eda_3d_viewer_frame.h b/3d-viewer/3d_viewer/eda_3d_viewer_frame.h index f651ab521d..9a5a73aee5 100644 --- a/3d-viewer/3d_viewer/eda_3d_viewer_frame.h +++ b/3d-viewer/3d_viewer/eda_3d_viewer_frame.h @@ -59,6 +59,7 @@ enum EDA_3D_VIEWER_STATUSBAR HOVERED_ITEM, X_POS, Y_POS, + ZOOM_LEVEL, }; /**