diff --git a/3d-viewer/3d_model_viewer/eda_3d_model_viewer.cpp b/3d-viewer/3d_model_viewer/eda_3d_model_viewer.cpp index 08d1c74c47..fc1b7eaf72 100644 --- a/3d-viewer/3d_model_viewer/eda_3d_model_viewer.cpp +++ b/3d-viewer/3d_model_viewer/eda_3d_model_viewer.cpp @@ -103,11 +103,6 @@ EDA_3D_MODEL_VIEWER::EDA_3D_MODEL_VIEWER( wxWindow* aParent, const wxGLAttribute m_BiuTo3dUnits = 1.0; m_glRC = nullptr; - - COMMON_SETTINGS* settings = Pgm().GetCommonSettings(); - - const DPI_SCALING_COMMON dpi{ settings, this }; - SetScaleFactor( dpi.GetScaleFactor() ); } diff --git a/3d-viewer/3d_viewer/eda_3d_viewer_frame.cpp b/3d-viewer/3d_viewer/eda_3d_viewer_frame.cpp index 8c630adce2..5c9a7bba7c 100644 --- a/3d-viewer/3d_viewer/eda_3d_viewer_frame.cpp +++ b/3d-viewer/3d_viewer/eda_3d_viewer_frame.cpp @@ -194,14 +194,6 @@ EDA_3D_VIEWER_FRAME::EDA_3D_VIEWER_FRAME( KIWAY* aKiway, PCB_BASE_FRAME* aParent wxLogTrace( wxT( "KI_TRACE_NAVLIB" ), e.what() ); } - Bind( wxEVT_DPI_CHANGED, - [&]( wxDPIChangedEvent& aEvt ) - { - const DPI_SCALING_COMMON dpi{ Pgm().GetCommonSettings(), this }; - m_canvas->SetScaleFactor( dpi.GetScaleFactor() ); - aEvt.Skip(); - } ); - // Fixes bug in Windows (XP and possibly others) where the canvas requires the focus // in order to receive mouse events. Otherwise, the user has to click somewhere on // the canvas before it will respond to mouse wheel events. @@ -819,9 +811,6 @@ void EDA_3D_VIEWER_FRAME::loadCommonSettings() COMMON_SETTINGS* settings = Pgm().GetCommonSettings(); - const DPI_SCALING_COMMON dpi{ settings, this }; - m_canvas->SetScaleFactor( dpi.GetScaleFactor() ); - // TODO(JE) use all control options m_boardAdapter.m_MousewheelPanning = settings->m_Input.scroll_modifier_zoom != 0; } diff --git a/3d-viewer/dialogs/panel_preview_3d_model.cpp b/3d-viewer/dialogs/panel_preview_3d_model.cpp index 497960e9aa..2d14397056 100644 --- a/3d-viewer/dialogs/panel_preview_3d_model.cpp +++ b/3d-viewer/dialogs/panel_preview_3d_model.cpp @@ -163,14 +163,6 @@ PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL( wxWindow* aParent, PCB_BASE_FRAM aFrame->Connect( EDA_EVT_UNITS_CHANGED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL::onUnitsChanged ), nullptr, this ); - - Bind( wxEVT_DPI_CHANGED, - [&]( wxDPIChangedEvent& aEvt ) - { - const DPI_SCALING_COMMON dpi{ Pgm().GetCommonSettings(), this }; - m_previewPane->SetScaleFactor( dpi.GetScaleFactor() ); - aEvt.Skip(); - } ); } @@ -200,9 +192,6 @@ void PANEL_PREVIEW_3D_MODEL::loadSettings() COMMON_SETTINGS* settings = Pgm().GetCommonSettings(); - const DPI_SCALING_COMMON dpi{ settings, this }; - m_previewPane->SetScaleFactor( dpi.GetScaleFactor() ); - // TODO(JE) use all control options m_boardAdapter.m_MousewheelPanning = settings->m_Input.scroll_modifier_zoom != 0; diff --git a/common/gal/hidpi_gl_canvas.cpp b/common/gal/hidpi_gl_canvas.cpp index e70b8c0c09..cc1223791e 100644 --- a/common/gal/hidpi_gl_canvas.cpp +++ b/common/gal/hidpi_gl_canvas.cpp @@ -34,8 +34,7 @@ HIDPI_GL_CANVAS::HIDPI_GL_CANVAS( const KIGFX::VC_SETTINGS& aSettings, wxWindow* const wxPoint& aPos, const wxSize& aSize, long aStyle, const wxString& aName, const wxPalette& aPalette ) : wxGLCanvas( aParent, aGLAttribs, aId, aPos, aSize, aStyle, aName, aPalette ), - m_settings( aSettings ), - m_scale_factor( DPI_SCALING::GetDefaultScaleFactor() ) + m_settings( aSettings ) { } @@ -64,13 +63,7 @@ wxPoint HIDPI_GL_CANVAS::GetNativePosition( const wxPoint& aPoint ) const } -void HIDPI_GL_CANVAS::SetScaleFactor( double aNewScaleFactor ) -{ - m_scale_factor = aNewScaleFactor; -} - - double HIDPI_GL_CANVAS::GetScaleFactor() const { - return m_scale_factor; + return GetContentScaleFactor(); } \ No newline at end of file diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index 1f9c563548..58779f37cc 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -515,13 +515,6 @@ bool OPENGL_GAL::updatedGalDisplayOptions( const GAL_DISPLAY_OPTIONS& aOptions ) refresh = true; } - if( m_options.m_scaleFactor != GetScaleFactor() ) - { - SetScaleFactor( m_options.m_scaleFactor ); - m_gridLineWidth = m_options.m_scaleFactor * ( m_options.m_gridLineWidth + 0.25 ); - refresh = true; - } - if( super::updatedGalDisplayOptions( aOptions ) || refresh ) { Refresh(); diff --git a/include/gal/hidpi_gl_canvas.h b/include/gal/hidpi_gl_canvas.h index 1e81403761..a39d7b0108 100644 --- a/include/gal/hidpi_gl_canvas.h +++ b/include/gal/hidpi_gl_canvas.h @@ -54,11 +54,6 @@ public: */ wxPoint GetNativePosition( const wxPoint& aPoint ) const; - /** - * Set the canvas scale factor, probably for a hi-DPI display. - */ - void SetScaleFactor( double aFactor ); - /** * Get the current scale factor */ @@ -69,12 +64,6 @@ public: protected: ///< Current VIEW_CONTROLS settings. KIGFX::VC_SETTINGS m_settings; - -private: - /** - * The current scale factor (e.g. for hi-DPI displays) - */ - double m_scale_factor; }; #endif // HIDPI_GL_CANVAS_H diff --git a/pcbnew/dialogs/dialog_footprint_chooser.cpp b/pcbnew/dialogs/dialog_footprint_chooser.cpp index ac82715729..0bac878b76 100644 --- a/pcbnew/dialogs/dialog_footprint_chooser.cpp +++ b/pcbnew/dialogs/dialog_footprint_chooser.cpp @@ -137,14 +137,6 @@ DIALOG_FOOTPRINT_CHOOSER::DIALOG_FOOTPRINT_CHOOSER( PCB_BASE_FRAME* aParent, Connect( FP_SELECTION_EVENT, wxCommandEventHandler( DIALOG_FOOTPRINT_CHOOSER::onFpChanged ), nullptr, this ); - - Bind( wxEVT_DPI_CHANGED, - [&]( wxDPIChangedEvent& aEvt ) - { - const DPI_SCALING_COMMON dpi{ Pgm().GetCommonSettings(), this }; - m_preview3DCanvas->SetScaleFactor( dpi.GetScaleFactor() ); - aEvt.Skip(); - } ); } @@ -188,9 +180,6 @@ void DIALOG_FOOTPRINT_CHOOSER::build3DCanvas() COMMON_SETTINGS* settings = Pgm().GetCommonSettings(); - const DPI_SCALING_COMMON dpi{ settings, this }; - m_preview3DCanvas->SetScaleFactor( dpi.GetScaleFactor() ); - // TODO(JE) use all control options m_boardAdapter.m_MousewheelPanning = settings->m_Input.scroll_modifier_zoom != 0; diff --git a/pcbnew/footprint_chooser_frame.cpp b/pcbnew/footprint_chooser_frame.cpp index 5980961ed4..f3122e98e7 100644 --- a/pcbnew/footprint_chooser_frame.cpp +++ b/pcbnew/footprint_chooser_frame.cpp @@ -191,14 +191,6 @@ FOOTPRINT_CHOOSER_FRAME::FOOTPRINT_CHOOSER_FRAME( KIWAY* aKiway, wxWindow* aPare Connect( FP_SELECTION_EVENT, // custom event fired by a PANEL_FOOTPRINT_CHOOSER wxCommandEventHandler( FOOTPRINT_CHOOSER_FRAME::onFpChanged ), nullptr, this ); - Bind( wxEVT_DPI_CHANGED, - [&]( wxDPIChangedEvent& aEvt ) - { - const DPI_SCALING_COMMON dpi{ Pgm().GetCommonSettings(), this }; - m_preview3DCanvas->SetScaleFactor( dpi.GetScaleFactor() ); - aEvt.Skip(); - } ); - // Needed on Linux to fix the position of widgets in bottomPanel PostSizeEvent(); }