33 const int* aAttribList,
34 const wxPoint& aPos,
const wxSize& aSize,
long aStyle,
35 const wxString& aName,
const wxPalette& aPalette ) :
36 wxGLCanvas( aParent, aId, aAttribList, aPos, aSize, aStyle, aName, aPalette ),
37 m_settings( aSettings ),
38 m_scale_factor(
DPI_SCALING::GetDefaultScaleFactor() )
45 wxSize size = wxGLCanvas::GetClientSize();
48 size.x *= scaleFactor;
49 size.y *= scaleFactor;
57 wxPoint nativePoint = aPoint;
60 nativePoint.x *= scaleFactor;
61 nativePoint.y *= scaleFactor;
Class to handle configuration and automatic determination of the DPI scale to use for canvases.
void SetScaleFactor(double aFactor)
Set the canvas scale factor, probably for a hi-DPI display.
virtual wxSize GetNativePixelSize() const
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)
wxPoint GetNativePosition(const wxPoint &aPoint) const
Convert the given point from client coordinates to native pixel coordinates.
double m_scale_factor
The current scale factor (e.g.
double GetScaleFactor() const
Get the current scale factor.
Structure to keep VIEW_CONTROLS settings for easy store/restore operations.