From a09b7c79278465ee1ad916697e0153eae640d8df Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 12 Feb 2013 10:25:03 +0000 Subject: 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 Signed-off-by: Chris Wilson --- src/cairo-path-fixed.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 -- cgit v1.2.3