X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fgdi%2Fregion.cpp;h=cbac53f8f2d9b1abc6f868164a762c2863fb7817;hp=f341e79a61de30aeb17bc6918c91be336acee6a7;hb=3bad22d5566624804a73b3791980bab2d84c8266;hpb=d6f6602d7cea3a7899990fe79216af7d98d05917 diff --git a/lib/gdi/region.cpp b/lib/gdi/region.cpp index f341e79..cbac53f 100644 --- a/lib/gdi/region.cpp +++ b/lib/gdi/region.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #undef max #define max(a,b) ((a) > (b) ? (a) : (b)) @@ -87,7 +88,7 @@ void gRegion::appendNonO(std::vector::const_iterator r, rects.reserve(rects.size() + newRects); do { assert(r->x1 < r->x2); - rects.push_back(eRect(r->x1, y1, r->x2, y2)); + rects.push_back(eRect(r->x1, y1, r->x2 - r->x1, y2 - y1)); r++; } while (r != rEnd); } @@ -110,7 +111,7 @@ void gRegion::intersectO( x2 = min(r1->x2, r2->x2); if (x1 < x2) - rects.push_back(eRect(x1, y1, x2, y2)); + rects.push_back(eRect(x1, y1, x2 - x1, y2 - y1)); if (r1->x2 == x2) r1++; if (r2->x2 == x2) @@ -145,7 +146,7 @@ void gRegion::subtractO( ++r2; } else if (r2->x1 < r1->x2) { assert(x1x1); - rects.push_back(eRect(x1, y1, r2->x1, y2)); + rects.push_back(eRect(x1, y1, r2->x1 - x1, y2 - y1)); x1 = r2->x2; if (x1 >= r1->x2) { ++r1; @@ -156,7 +157,7 @@ void gRegion::subtractO( } else { if (r1->x2 > x1) - rects.push_back(eRect(x1, y1, r1->x2, y2)); + rects.push_back(eRect(x1, y1, r1->x2 - x1, y2 - y1)); ++r1; if (r1 != r1End) x1 = r1->x1; @@ -165,7 +166,7 @@ void gRegion::subtractO( while (r1 != r1End) { assert(x1x2); - rects.push_back(eRect(x1, y1, r1->x2, y2)); + rects.push_back(eRect(x1, y1, r1->x2 - x1, y2 - y1)); ++r1; if (r1 != r1End) x1 = r1->x1; @@ -180,7 +181,7 @@ void gRegion::subtractO( if (x2 < r->x2) x2 = r->x2; \ } else { \ /* Add current rectangle, start new one */ \ - rects.push_back(eRect(x1, y1, x2, y2)); \ + rects.push_back(eRect(x1, y1, x2 - x1, y2 - y1)); \ x1 = r->x1; \ x2 = r->x2; \ } \ @@ -225,7 +226,7 @@ void gRegion::mergeO( MERGERECT(r2); } while (r2 != r2End); } - rects.push_back(eRect(x1, y1, x2, y2)); + rects.push_back(eRect(x1, y1, x2 - x1, y2 - y1)); } void gRegion::regionOp(const gRegion ®1, const gRegion ®2, int opcode, int &overlap) @@ -318,10 +319,24 @@ void gRegion::regionOp(const gRegion ®1, const gRegion ®2, int opcode, int coalesce(prevBand, curBand); AppendRegions(r2BandEnd, r2End); } + extends = eRect(); + + for (int a=0; a