]> git.saurik.com Git - wxWidgets.git/commitdiff
fixing naming to GetScaleFactor, adding default Create with a dc parameter
authorStefan Csomor <csomor@advancedconcepts.ch>
Tue, 25 Jun 2013 13:54:15 +0000 (13:54 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Tue, 25 Jun 2013 13:54:15 +0000 (13:54 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74286 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/bitmap.h
src/common/bmpbase.cpp

index 791b721d226194b8ab45a4678f729ae8aeb755a9..c6eceb596c6830a64d560f913af996782ce34e6d 100644 (file)
@@ -26,6 +26,7 @@ class WXDLLIMPEXP_FWD_CORE wxBitmapHandler;
 class WXDLLIMPEXP_FWD_CORE wxIcon;
 class WXDLLIMPEXP_FWD_CORE wxMask;
 class WXDLLIMPEXP_FWD_CORE wxPalette;
+class WXDLLIMPEXP_FWD_CORE wxDC;
 
 // ----------------------------------------------------------------------------
 // wxVariant support
@@ -174,6 +175,8 @@ public:
 
     virtual bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH) = 0;
     virtual bool Create(const wxSize& sz, int depth = wxBITMAP_SCREEN_DEPTH) = 0;
+    // Create a bitmap compatible with the given DC, inheriting its magnification factor
+    virtual bool Create(int width, int height, const wxDC& dc);
 
     virtual int GetHeight() const = 0;
     virtual int GetWidth() const = 0;
@@ -183,9 +186,9 @@ public:
         { return wxSize(GetWidth(), GetHeight()); }
 
     // support for scaled bitmaps
-    virtual double GetScale() const { return 1.0; }
-    virtual double GetScaledWidth() const { return GetWidth() / GetScale(); }
-    virtual double GetScaledHeight() const { return GetHeight() / GetScale(); }
+    virtual double GetScaleFactor() const { return 1.0; }
+    virtual double GetScaledWidth() const { return GetWidth() / GetScaleFactor(); }
+    virtual double GetScaledHeight() const { return GetHeight() / GetScaleFactor(); }
     virtual wxSize GetScaledSize() const
     { return wxSize(GetScaledWidth(), GetScaledHeight()); }
 
index 46804febbd8436d329f880f9098bb8f17fd92500..1a0c5d7809c7bc94ddc495962e28d621260a10c8 100644 (file)
@@ -87,6 +87,11 @@ IMPLEMENT_ABSTRACT_CLASS(wxBitmapHandler, wxObject)
 
 wxList wxBitmapBase::sm_handlers;
 
+bool wxBitmapBase::Create(int width, int height, const wxDC& WXUNUSED(dc))
+{
+    return Create(width,height);
+}
+
 void wxBitmapBase::AddHandler(wxBitmapHandler *handler)
 {
     sm_handlers.Append(handler);