Allow drawing HiDPI bitmaps with GTK3
1. Override wxWindow::GetContentScaleFactor() to use gdk_window_get_scale_factor() when available, and to use correct scale (1.0) otherwise, as wxDC::GetPPI() (used by overridden method) is not properly implemented for wxGTK 2. Record scale in wxBitmap(wxImage&) ctor and wxBitmap::CreateScaled() 3. Adjust cairo scale for drawing bitmap, and (inversely) for drawing on bitmap
This commit is contained in:
@@ -90,7 +90,10 @@ public:
|
||||
{ return Create(sz.GetWidth(), sz.GetHeight(), depth); }
|
||||
bool Create(int width, int height, const wxDC& WXUNUSED(dc))
|
||||
{ return Create(width,height); }
|
||||
|
||||
#ifdef __WXGTK3__
|
||||
virtual bool CreateScaled(int w, int h, int depth, double scale) wxOVERRIDE;
|
||||
virtual double GetScaleFactor() const wxOVERRIDE;
|
||||
#endif
|
||||
|
||||
virtual int GetHeight() const wxOVERRIDE;
|
||||
virtual int GetWidth() const wxOVERRIDE;
|
||||
|
Reference in New Issue
Block a user