X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f790ec82e7fb0e8fa30bd1b3d71dbbef9bd4dcf8..489a164c1c56855b29285230237c69514ff823e1:/include/wx/gdicmn.h diff --git a/include/wx/gdicmn.h b/include/wx/gdicmn.h index 242e0f9ea8..bc3efb2c50 100644 --- a/include/wx/gdicmn.h +++ b/include/wx/gdicmn.h @@ -229,6 +229,15 @@ public: void DecTo(const wxSize& sz) { if ( sz.x < x ) x = sz.x; if ( sz.y < y ) y = sz.y; } + void IncBy(int dx, int dy) { x += dx; y += dy; } + void IncBy(const wxSize& sz) { IncBy(sz.x, sz.y); } + void IncBy(int d) { IncBy(d, d); } + + void DecBy(int dx, int dy) { IncBy(-dx, -dy); } + void DecBy(const wxSize& sz) { DecBy(sz.x, sz.y); } + void DecBy(int d) { DecBy(d, d); } + + void Scale(float xscale, float yscale) { x = (int)(x*xscale); y = (int)(y*yscale); } @@ -386,6 +395,7 @@ public: // operations with rect wxRect& Inflate(wxCoord dx, wxCoord dy); + wxRect& Inflate(const wxSize& d) { return Inflate(d.x, d.y); } wxRect& Inflate(wxCoord d) { return Inflate(d, d); } wxRect Inflate(wxCoord dx, wxCoord dy) const { @@ -395,6 +405,7 @@ public: } wxRect& Deflate(wxCoord dx, wxCoord dy) { return Inflate(-dx, -dy); } + wxRect& Deflate(const wxSize& d) { return Inflate(-d.x, -d.y); } wxRect& Deflate(wxCoord d) { return Inflate(-d); } wxRect Deflate(wxCoord dx, wxCoord dy) const {