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 405669d3b5..f40780d923 100644 --- a/3d-viewer/3d_model_viewer/eda_3d_model_viewer.cpp +++ b/3d-viewer/3d_model_viewer/eda_3d_model_viewer.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2015-2016 Mario Luzeiro - * Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -23,10 +23,8 @@ */ /** - * @file c3d_model_viewer.cpp - * @brief Implements a model viewer canvas. The propose of model viewer is to - * render 3d models that come in the original data from the files without any - * transformations. + * @brief Implements a model viewer canvas. The purpose of the model viewer is to render + * 3d models that come in the original data from the files without any transformations. */ #include @@ -34,7 +32,6 @@ #include "eda_3d_model_viewer.h" #include "../3d_rendering/legacy/ogl_legacy_utils.h" #include "../3d_cache/3d_cache.h" -#include "common_ogl/ogl_utils.h" #include #include #include @@ -111,7 +108,7 @@ EDA_3D_MODEL_VIEWER::EDA_3D_MODEL_VIEWER( wxWindow* aParent, const int* aAttribL EDA_3D_MODEL_VIEWER::~EDA_3D_MODEL_VIEWER() { - wxLogTrace( m_logTrace, wxT( "EDA_3D_MODEL_VIEWER::EDA_3D_MODEL_VIEWERWER" ) ); + wxLogTrace( m_logTrace, wxT( "EDA_3D_MODEL_VIEWER::~EDA_3D_MODEL_VIEWER" ) ); if( m_glRC ) { @@ -252,7 +249,7 @@ void EDA_3D_MODEL_VIEWER::OnPaint( wxPaintEvent& event ) // multiple canvases: If we updated the viewport in the wxSizeEvent // handler, changing the size of one canvas causes a viewport setting that // is wrong when next another canvas is repainted. - wxSize clientSize = GetClientSize(); + wxSize clientSize = GetNativePixelSize(); if( !m_ogl_initialized ) { @@ -404,7 +401,7 @@ void EDA_3D_MODEL_VIEWER::OnMagnify( wxMouseEvent& event ) void EDA_3D_MODEL_VIEWER::OnMouseMove( wxMouseEvent& event ) { - m_trackBallCamera.SetCurWindowSize( GetClientSize() ); + m_trackBallCamera.SetCurWindowSize( GetNativePixelSize() ); if( event.Dragging() ) { diff --git a/common/gal/hidpi_gl_canvas.cpp b/common/gal/hidpi_gl_canvas.cpp index b316e3772b..0585d9e7ce 100644 --- a/common/gal/hidpi_gl_canvas.cpp +++ b/common/gal/hidpi_gl_canvas.cpp @@ -30,16 +30,11 @@ HIDPI_GL_CANVAS::HIDPI_GL_CANVAS( wxWindow* parent, wxWindowID id, const int* attribList, - const wxPoint& pos, const wxSize& size, long style, const wxString& name, - const wxPalette& palette ) - : wxGLCanvas( parent, id, attribList, pos, size, style, name, palette ), - m_scale_factor( DPI_SCALING::GetDefaultScaleFactor() ) + const wxPoint& pos, const wxSize& size, long style, + const wxString& name, const wxPalette& palette ) : + wxGLCanvas( parent, id, attribList, pos, size, style, name, palette ), + m_scale_factor( DPI_SCALING::GetDefaultScaleFactor() ) { - // As of wxWidgets version 3.1.3, this is the default behavior of the wxGLCanvas on OSX - // so this piece of code can be removed once our minimum version is >3.1.3 for OSX. -#ifdef RETINA_OPENGL_PATCH - SetViewWantsBestResolution( true ); -#endif }