summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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++;