X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/aed8ac3f8954c07fb2dee3e2ba9ae02fa8890428..fb10f04c957b3712c04ddec92d083209e127b011:/src/gtk1/region.cpp diff --git a/src/gtk1/region.cpp b/src/gtk1/region.cpp index a19730b0d0..5718597469 100644 --- a/src/gtk1/region.cpp +++ b/src/gtk1/region.cpp @@ -16,19 +16,17 @@ #include #include + //----------------------------------------------------------------------------- // wxRegion //----------------------------------------------------------------------------- class wxRegionRefData: public wxObjectRefData { - public: - +public: wxRegionRefData(); ~wxRegionRefData(); - public: - GdkRegion *m_region; wxList m_rects; }; @@ -259,40 +257,12 @@ void wxRegion::GetBox( long& x, long& y, long&w, long &h ) const y = 0; w = -1; h = -1; - wxNode *node = GetRectList()->First(); - while (node) - { - wxRect *r = (wxRect*)node->Data(); - if (node == GetRectList()->First()) - { - x = r->x; - y = r->y; - w = r->width; - h = r->height; - } - else - { - if (r->x < x) - { - x = r->x; - w += x - r->x; - } - if (r->y < y) - { - y = r->y; - h += y - r->y; - } - if (r->width+r->x > x+w) - { - w = r->x + r->width - x; - } - if (r->height+r->y > y+h) - { - h = r->y + r->height - y; - } - } - node = node->Next(); - } + GdkRectangle rect; + gdk_region_get_clipbox( M_REGIONDATA->m_region, &rect ); + x = rect.x; + y = rect.y; + w = rect.width; + h = rect.height; } wxRect wxRegion::GetBox() const