summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-04-03 09:24:06 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-04-03 09:24:06 +0100
commit87a672dafd9d6f47f31b77b406b7f0fb2b4030ac (patch)
treed9e52cfe642c4f6101f40fbb3e72432b1c9205c5
parent0a0ee491ea18dc59748ff4419ae73bd1a369ae79 (diff)
sna: Apply CoordMode when computing point extents
Reported-by: Patrick Truebe <eko-priv@gmx.net> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48220 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 6eee977c..f1d4d00b 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -5556,9 +5556,19 @@ sna_poly_point_extents(DrawablePtr drawable, GCPtr gc,
box.x2 = box.x1 = pt->x;
box.y2 = box.y1 = pt->y;
- while (--n) {
- pt++;
- box_add_pt(&box, pt->x, pt->y);
+ if (mode == CoordModePrevious) {
+ DDXPointRec last = *pt++;
+ while (--n) {
+ last.x += pt->x;
+ last.y += pt->y;
+ pt++;
+ box_add_pt(&box, last.x, last.y);
+ }
+ } else {
+ while (--n) {
+ ++pt;
+ box_add_pt(&box, pt->x, pt->y);
+ }
}
box.x2++;
box.y2++;