Fix bug in union and intersection functions

The x and y values of the flush area are bogus just after
a flush when the flush area has a width of 0.  We need to
special case that situation to perform the union/intersection
operations without looking at x and y.
calculate-0.9.5
Ray Strode 17 years ago
parent 895c827a9f
commit 6226cd1119

@ -393,6 +393,18 @@ ply_frame_buffer_area_union (ply_frame_buffer_area_t *area1,
{
unsigned long x1, y1, x2, y2;
if (area1->width == 0)
{
*result = *area2;
return;
}
if (area2->width == 0)
{
*result = *area1;
return;
}
x1 = area1->x + area1->width;
y1 = area1->y + area1->height;
x2 = area2->x + area2->width;
@ -604,6 +616,18 @@ ply_frame_buffer_area_intersect (ply_frame_buffer_area_t *area1,
{
unsigned long x1, y1, x2, y2;
if (area1->width == 0)
{
*result = *area1;
return;
}
if (area2->width == 0)
{
*result = *area2;
return;
}
x1 = area1->x + area1->width;
y1 = area1->y + area1->height;
x2 = area2->x + area2->width;

Loading…
Cancel
Save