summaryrefslogtreecommitdiff
path: root/src/cairo-path-fixed.c
diff options
context:
space:
mode:
authorAndrea Canciani <ranma42@gmail.com>2010-10-22 23:16:21 +0200
committerAndrea Canciani <ranma42@gmail.com>2010-10-29 17:31:24 +0200
commitb8444a5c78c5d254b21331353884bcfe8efb0a5e (patch)
tree684fadda4b6d4b701f03c98eacb5569c3caa2aca /src/cairo-path-fixed.c
parent89e1261dd0fdb6c6c0271f71dd84d72504969ab1 (diff)
downloadcairo-b8444a5c78c5d254b21331353884bcfe8efb0a5e.tar.gz
path: Tighten transformed extents
The transformation code should produce tight extents if they are to be used in the new simple extents functions.
Diffstat (limited to 'src/cairo-path-fixed.c')
-rw-r--r--src/cairo-path-fixed.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/cairo-path-fixed.c b/src/cairo-path-fixed.c
index fd7bdcda1..3093f2604 100644
--- a/src/cairo-path-fixed.c
+++ b/src/cairo-path-fixed.c
@@ -1055,6 +1055,7 @@ void
_cairo_path_fixed_transform (cairo_path_fixed_t *path,
const cairo_matrix_t *matrix)
{
+ cairo_box_t extents;
cairo_point_t point;
cairo_path_buf_t *buf;
unsigned int i;
@@ -1076,6 +1077,7 @@ _cairo_path_fixed_transform (cairo_path_fixed_t *path,
if (buf->num_points == 0)
return;
+ extents = path->extents;
point = buf->points[0];
_cairo_path_fixed_transform_point (&point, matrix);
_cairo_box_set (&path->extents, &point, &point);
@@ -1087,6 +1089,19 @@ _cairo_path_fixed_transform (cairo_path_fixed_t *path,
}
} cairo_path_foreach_buf_end (buf, path);
+ if (path->has_curve_to) {
+ cairo_bool_t is_tight;
+
+ _cairo_matrix_transform_bounding_box_fixed (matrix, &extents, &is_tight);
+ if (!is_tight) {
+ cairo_bool_t has_extents;
+
+ has_extents = _cairo_path_bounder_extents (path, &extents);
+ assert (has_extents);
+ }
+ path->extents = extents;
+ }
+
/* flags might become more strict than needed */
path->stroke_is_rectilinear = FALSE;
path->fill_is_rectilinear = FALSE;