diff --git a/include/wx/gdicmn.h b/include/wx/gdicmn.h index e6368d8ff2..24ff44ab5c 100644 --- a/include/wx/gdicmn.h +++ b/include/wx/gdicmn.h @@ -255,6 +255,13 @@ public: { if ( sz.x > x ) x = sz.x; if ( sz.y > y ) y = sz.y; } void DecTo(const wxSize& sz) { if ( sz.x < x ) x = sz.x; if ( sz.y < y ) y = sz.y; } + void DecToIfSpecified(const wxSize& sz) + { + if ( sz.x != wxDefaultCoord && sz.x < x ) + x = sz.x; + if ( sz.y != wxDefaultCoord && sz.y < y ) + y = sz.y; + } void IncBy(int dx, int dy) { x += dx; y += dy; } void IncBy(const wxPoint& pt); diff --git a/interface/wx/gdicmn.h b/interface/wx/gdicmn.h index f043636096..f69ace97be 100644 --- a/interface/wx/gdicmn.h +++ b/interface/wx/gdicmn.h @@ -873,6 +873,18 @@ public: */ void DecTo(const wxSize& size); + /** + Decrements this object to be not bigger than the given size ignoring + non-specified components. + + This is similar to DecTo() but doesn't do anything for x or y + component if the same component of @a size is not specified, i.e. set + to ::wxDefaultCoord. + + @since 2.9.5 + */ + void DecToIfSpecified(const wxSize& size); + /** Gets the height member. */