git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix seekable status when service is already running, only show infobar if InfoBarShow...
[enigma2.git]
/
lib
/
gdi
/
region.cpp
diff --git
a/lib/gdi/region.cpp
b/lib/gdi/region.cpp
index cbac53f8f2d9b1abc6f868164a762c2863fb7817..d75221fe882f6e2794be6555e6c94a29c2eaad8f 100644
(file)
--- a/
lib/gdi/region.cpp
+++ b/
lib/gdi/region.cpp
@@
-26,10
+26,11
@@
gRegion::gRegion(const eRect &rect) : extends(rect)
{
gRegion::gRegion(const eRect &rect) : extends(rect)
{
- rects.push_back(rect);
+ if (rect.valid() && !rect.empty())
+ rects.push_back(rect);
}
}
-gRegion::gRegion()
+gRegion::gRegion()
: extends(eRect::emptyRect())
{
}
{
}
@@
-265,8
+266,8
@@
void gRegion::regionOp(const gRegion ®1, const gRegion ®2, int opcode, int
bot = min(r1->y2, r2y1);
if (top != bot) {
curBand = rects.size();
bot = min(r1->y2, r2y1);
if (top != bot) {
curBand = rects.size();
-
appendNonO(r1, r1BandEnd, top, bot);
-
coalesce(prevBand, curBand);
+ appendNonO(r1, r1BandEnd, top, bot);
+ coalesce(prevBand, curBand);
}
}
ytop = r2y1;
}
}
ytop = r2y1;
@@
-319,22
+320,26
@@
void gRegion::regionOp(const gRegion ®1, const gRegion ®2, int opcode, int
coalesce(prevBand, curBand);
AppendRegions(r2BandEnd, r2End);
}
coalesce(prevBand, curBand);
AppendRegions(r2BandEnd, r2End);
}
+
extends = eRect();
extends = eRect();
- for (int a=0; a<rects.size(); ++a)
- extends = extends | eRect(rects[0].topLeft(), rects[rects.size()-1].bottomRight());
+ for (unsigned int a = 0; a<rects.size(); ++a)
+ extends = extends | rects[a];
+ if (!extends.valid())
+ extends = eRect::emptyRect();
}
void gRegion::intersect(const gRegion &r1, const gRegion &r2)
{
}
void gRegion::intersect(const gRegion &r1, const gRegion &r2)
{
+ /* in case one region is empty, the resulting regions is empty, too. */
if (r1.rects.empty())
{
if (r1.rects.empty())
{
- *this = r
2
;
+ *this = r
1
;
return;
}
if (r2.rects.empty())
{
return;
}
if (r2.rects.empty())
{
- *this = r
1
;
+ *this = r
2
;
return;
}
int overlap;
return;
}
int overlap;
@@
-416,7
+421,7
@@
gRegion &gRegion::operator|=(const gRegion &r2)
void gRegion::moveBy(ePoint offset)
{
extends.moveBy(offset);
void gRegion::moveBy(ePoint offset)
{
extends.moveBy(offset);
- int i;
+
unsigned
int i;
for (i=0; i<rects.size(); ++i)
rects[i].moveBy(offset);
}
for (i=0; i<rects.size(); ++i)
rects[i].moveBy(offset);
}