summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-02-12 10:25:03 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-02-12 10:27:58 +0000
commita09b7c79278465ee1ad916697e0153eae640d8df (patch)
treec57f78caaaabe595ed09d1235a04e987075c707d
parentbe1561dadece6e947a3ca78d1124197b4278ce96 (diff)
path: Fix bbox computation for negative scale factors
The fast path for transforming a path by a simple scale factor, forgot to fix up the orientation of the box if that scale factor was negative. Reported-by: Edward Zimmermann <Edward.Zimmermann@cib.de> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/cairo-path-fixed.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/cairo-path-fixed.c b/src/cairo-path-fixed.c
index 66fbdfe1..10a65159 100644
--- a/src/cairo-path-fixed.c
+++ b/src/cairo-path-fixed.c
@@ -965,8 +965,19 @@ _cairo_path_fixed_offset_and_scale (cairo_path_fixed_t *path,
path->extents.p1.x = _cairo_fixed_mul (scalex, path->extents.p1.x) + offx;
path->extents.p2.x = _cairo_fixed_mul (scalex, path->extents.p2.x) + offx;
+ if (scalex < 0) {
+ cairo_fixed_t t = path->extents.p1.x;
+ path->extents.p1.x = path->extents.p2.x;
+ path->extents.p2.x = t;
+ }
+
path->extents.p1.y = _cairo_fixed_mul (scaley, path->extents.p1.y) + offy;
path->extents.p2.y = _cairo_fixed_mul (scaley, path->extents.p2.y) + offy;
+ if (scaley < 0) {
+ cairo_fixed_t t = path->extents.p1.y;
+ path->extents.p1.y = path->extents.p2.y;
+ path->extents.p2.y = t;
+ }
}
void