path: Recompute flags in _cairo_path_fixed_translate

Only fill_maybe_region can change its value because the transformation
preserves vertical and horizontal lines, but can move the points and
make them integer if they were not or non-integer if they were.

Recomputing it is just as easy as checking if all the points are
integer and the path is fill_is_rectilinear.
This commit is contained in:
Andrea Canciani 2010-10-22 22:19:48 +02:00
parent 9d84dff0c6
commit 9c0e4db570

View file

@ -1015,26 +1015,27 @@ _cairo_path_fixed_translate (cairo_path_fixed_t *path,
if (offx == 0 && offy == 0)
return;
/* Recompute an approximation of the flags.
* It might be more strict than what is actually needed.
*/
if (path->fill_maybe_region) {
path->fill_maybe_region = _cairo_fixed_is_integer (offx) &&
_cairo_fixed_is_integer (offy);
}
path->last_move_point.x += offx;
path->last_move_point.y += offy;
path->current_point.x += offx;
path->current_point.y += offy;
path->fill_maybe_region = TRUE;
cairo_path_foreach_buf_start (buf, path) {
for (i = 0; i < buf->num_points; i++) {
buf->points[i].x += offx;
buf->points[i].y += offy;
for (i = 0; i < buf->num_points; i++) {
buf->points[i].x += offx;
buf->points[i].y += offy;
if (path->fill_maybe_region) {
path->fill_maybe_region = _cairo_fixed_is_integer (buf->points[i].x) &&
_cairo_fixed_is_integer (buf->points[i].y);
}
}
} cairo_path_foreach_buf_end (buf, path);
path->fill_maybe_region &= path->fill_is_rectilinear;
path->extents.p1.x += offx;
path->extents.p1.y += offy;
path->extents.p2.x += offx;