Bitmap: Normalize rectangle passed to pixman

This commit is contained in:
Jonas Kulla 2014-08-09 08:04:56 +02:00
parent 88bb92aadc
commit bdcf1503bd
1 changed files with 17 additions and 1 deletions

View File

@ -111,8 +111,24 @@ struct BitmapPrivate
void addTaintedArea(const IntRect &rect)
{
/* Normalize (= ensure width and
* height are positive) */
IntRect norm = rect;
if (norm.w < 0)
{
norm.x += norm.w;
norm.w = -norm.w;
}
if (norm.h < 0)
{
norm.y += norm.h;
norm.h = -norm.h;
}
pixman_region_union_rect
(&tainted, &tainted, rect.x, rect.y, rect.w, rect.h);
(&tainted, &tainted, norm.x, norm.y, norm.w, norm.h);
}
void substractTaintedArea(const IntRect &rect)