]> git.saurik.com Git - wxWidgets.git/commitdiff
adding Offset to wxRegion / carbon
authorStefan Csomor <csomor@advancedconcepts.ch>
Sun, 24 Oct 2004 11:43:07 +0000 (11:43 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Sun, 24 Oct 2004 11:43:07 +0000 (11:43 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30090 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/mac/carbon/region.h
src/mac/carbon/region.cpp

index 923a0014ad02b7315760d6affa8b687f83dea63f..dfac421db5774912bc172b9de5b1df9e8e8bb84e 100644 (file)
@@ -69,6 +69,9 @@ public:
     // Clear current region
     void Clear();
 
+    // Move the region
+    bool Offset(wxCoord x, wxCoord y);
+
     // Union rectangle or region with this.
     bool Union(long x, long y, long width, long height)
         { return Combine(x, y, width, height, wxRGN_OR); }
index c1ef0182d4094c5f8ccb01429c446f7855677e5e..aefaa806930ece47ecf515dfdb3dd78a2e661898 100644 (file)
@@ -128,6 +128,22 @@ void wxRegion::Clear()
     UnRef();
 }
 
+// Move the region
+bool wxRegion::Offset(wxCoord x, wxCoord y)
+{
+    wxCHECK_MSG( M_REGION, false, _T("invalid wxRegion") );
+
+    if ( !x && !y )
+    {
+        // nothing to do
+        return true;
+    }
+
+    OffsetRgn( M_REGION , x , y ) ;
+    return true ;
+}
+
+
 //! Combine rectangle (x, y, w, h) with this.
 bool wxRegion::Combine(long x, long y, long width, long height, wxRegionOp op)
 {