KiCad PCB EDA Suite
|
wxGLCanvas wrapper for HiDPI/Retina support. More...
#include <hidpi_gl_canvas.h>
Public Member Functions | |
HIDPI_GL_CANVAS (const KIGFX::VC_SETTINGS &aSettings, wxWindow *aParent, wxWindowID aId=wxID_ANY, const int *aAttribList=nullptr, const wxPoint &aPos=wxDefaultPosition, const wxSize &aSize=wxDefaultSize, long aStyle=0, const wxString &aName=wxGLCanvasName, const wxPalette &aPalette=wxNullPalette) | |
virtual wxSize | GetNativePixelSize () const |
wxPoint | GetNativePosition (const wxPoint &aPoint) const |
Convert the given point from client coordinates to native pixel coordinates. More... | |
void | SetScaleFactor (double aFactor) |
Set the canvas scale factor, probably for a hi-DPI display. More... | |
double | GetScaleFactor () const |
Get the current scale factor. More... | |
void | SetVcSettings (const KIGFX::VC_SETTINGS &aVcSettings) |
Protected Attributes | |
KIGFX::VC_SETTINGS | m_settings |
< Current VIEW_CONTROLS settings. More... | |
Private Attributes | |
double | m_scale_factor |
The current scale factor (e.g. More... | |
wxGLCanvas wrapper for HiDPI/Retina support.
This is a small wrapper class to enable HiDPI/Retina support for wxGLCanvas.
Definition at line 40 of file hidpi_gl_canvas.h.
HIDPI_GL_CANVAS::HIDPI_GL_CANVAS | ( | const KIGFX::VC_SETTINGS & | aSettings, |
wxWindow * | aParent, | ||
wxWindowID | aId = wxID_ANY , |
||
const int * | aAttribList = nullptr , |
||
const wxPoint & | aPos = wxDefaultPosition , |
||
const wxSize & | aSize = wxDefaultSize , |
||
long | aStyle = 0 , |
||
const wxString & | aName = wxGLCanvasName , |
||
const wxPalette & | aPalette = wxNullPalette |
||
) |
Definition at line 32 of file hidpi_gl_canvas.cpp.
|
virtual |
Definition at line 43 of file hidpi_gl_canvas.cpp.
References GetScaleFactor().
Referenced by EDA_3D_CANVAS::DoRePaint(), EDA_3D_MODEL_VIEWER::OnMouseMove(), HIDPI_GL_3D_CANVAS::OnMouseMoveCamera(), EDA_3D_MODEL_VIEWER::OnPaint(), and KIGFX::OPENGL_GAL::OPENGL_GAL().
wxPoint HIDPI_GL_CANVAS::GetNativePosition | ( | const wxPoint & | aPoint | ) | const |
Convert the given point from client coordinates to native pixel coordinates.
Definition at line 55 of file hidpi_gl_canvas.cpp.
References GetScaleFactor().
Referenced by EDA_3D_MODEL_VIEWER::OnMouseMove(), HIDPI_GL_3D_CANVAS::OnMouseMoveCamera(), and HIDPI_GL_3D_CANVAS::OnMouseWheelCamera().
double HIDPI_GL_CANVAS::GetScaleFactor | ( | ) | const |
Get the current scale factor.
Definition at line 73 of file hidpi_gl_canvas.cpp.
References m_scale_factor.
Referenced by KIGFX::OPENGL_GAL::BeginDrawing(), KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::PREVIEW::GetConstantGlyphHeight(), GetNativePixelSize(), GetNativePosition(), KIGFX::OPENGL_GAL::getScreenPixelSize(), KIGFX::OPENGL_GAL::ResizeScreen(), and KIGFX::OPENGL_GAL::updatedGalDisplayOptions().
void HIDPI_GL_CANVAS::SetScaleFactor | ( | double | aFactor | ) |
Set the canvas scale factor, probably for a hi-DPI display.
Definition at line 67 of file hidpi_gl_canvas.cpp.
References m_scale_factor.
Referenced by EDA_3D_MODEL_VIEWER::EDA_3D_MODEL_VIEWER(), EDA_3D_VIEWER_FRAME::loadCommonSettings(), PANEL_PREVIEW_3D_MODEL::loadSettings(), and KIGFX::OPENGL_GAL::updatedGalDisplayOptions().
|
inline |
Definition at line 67 of file hidpi_gl_canvas.h.
Referenced by EDA_3D_VIEWER_FRAME::LoadSettings().
|
private |
The current scale factor (e.g.
for hi-DPI displays)
Definition at line 77 of file hidpi_gl_canvas.h.
Referenced by GetScaleFactor(), and SetScaleFactor().
|
protected |
< Current VIEW_CONTROLS settings.
Definition at line 71 of file hidpi_gl_canvas.h.
Referenced by HIDPI_GL_3D_CANVAS::OnMouseWheelCamera().