miext/damage: take care of the coordinate mode in damagePolyPoint
The mode (CoordModeOrigin or CoordModePrevious) was not taken into
account when computing the box. The result was a bad drawing of
points in some situations (on my hardware/software configuration,
calling XDrawString followed by XDrawPoints in the mode
CoordModePrevious).
Signed-off-by: Cedric Roux <sed@free.fr>
Signed-off-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit bc36594e0e
)
This commit is contained in:
parent
c26a47b4f2
commit
9403335910
|
@ -829,6 +829,25 @@ damagePolyPoint(DrawablePtr pDrawable,
|
||||||
|
|
||||||
/* this could be slow if the points were spread out */
|
/* this could be slow if the points were spread out */
|
||||||
|
|
||||||
|
if (mode == CoordModePrevious) {
|
||||||
|
int x = box.x1;
|
||||||
|
int y = box.y1;
|
||||||
|
|
||||||
|
while (--nptTmp) {
|
||||||
|
pptTmp++;
|
||||||
|
x += pptTmp->x;
|
||||||
|
y += pptTmp->y;
|
||||||
|
if (box.x1 > x)
|
||||||
|
box.x1 = x;
|
||||||
|
else if (box.x2 < x)
|
||||||
|
box.x2 = x;
|
||||||
|
if (box.y1 > y)
|
||||||
|
box.y1 = y;
|
||||||
|
else if (box.y2 < y)
|
||||||
|
box.y2 = y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
while (--nptTmp) {
|
while (--nptTmp) {
|
||||||
pptTmp++;
|
pptTmp++;
|
||||||
if (box.x1 > pptTmp->x)
|
if (box.x1 > pptTmp->x)
|
||||||
|
@ -840,6 +859,7 @@ damagePolyPoint(DrawablePtr pDrawable,
|
||||||
else if (box.y2 < pptTmp->y)
|
else if (box.y2 < pptTmp->y)
|
||||||
box.y2 = pptTmp->y;
|
box.y2 = pptTmp->y;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
box.x2++;
|
box.x2++;
|
||||||
box.y2++;
|
box.y2++;
|
||||||
|
|
Loading…
Reference in New Issue