summaryrefslogtreecommitdiff
path: root/src/cairo-path-fixed.c
diff options
context:
space:
mode:
authorVladimir Vukicevic <vladimir@pobox.com>2007-08-20 17:32:05 -0700
committerVladimir Vukicevic <vladimir@binky.(none)>2007-08-20 17:32:05 -0700
commitf97bb5613a7fb3d92f2d730460f9c721ee13a41a (patch)
treebeddfe466aa175ad6544304d185483d2684c7c7c /src/cairo-path-fixed.c
parent51b6cca8de3181d7b42b612ff491451c765d5811 (diff)
Fix path_fixed_offset_and_scale to apply scale and offset in right order
Diffstat (limited to 'src/cairo-path-fixed.c')
-rw-r--r--src/cairo-path-fixed.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/src/cairo-path-fixed.c b/src/cairo-path-fixed.c
index 89380d38d..86c771ee3 100644
--- a/src/cairo-path-fixed.c
+++ b/src/cairo-path-fixed.c
@@ -513,17 +513,13 @@ _cairo_path_fixed_offset_and_scale (cairo_path_fixed_t *path,
while (buf) {
for (i = 0; i < buf->num_points; i++) {
- if (scalex == CAIRO_FIXED_ONE) {
- buf->points[i].x += offx;
- } else {
- buf->points[i].x = _cairo_fixed_mul (buf->points[i].x + offx, scalex);
- }
-
- if (scaley == CAIRO_FIXED_ONE) {
- buf->points[i].y += offy;
- } else {
- buf->points[i].y = _cairo_fixed_mul (buf->points[i].y + offy, scaley);
- }
+ if (scalex != CAIRO_FIXED_ONE)
+ buf->points[i].x = _cairo_fixed_mul (buf->points[i].x, scalex);
+ buf->points[i].x += offx;
+
+ if (scaley != CAIRO_FIXED_ONE)
+ buf->points[i].y = _cairo_fixed_mul (buf->points[i].y, scaley);
+ buf->points[i].y += offy;
}
buf = buf->next;
@@ -546,10 +542,8 @@ _cairo_path_fixed_device_transform (cairo_path_fixed_t *path,
cairo_matrix_t *device_transform)
{
assert (device_transform->yx == 0.0 && device_transform->xy == 0.0);
- /* XXX: FRAGILE: I'm not really sure whether we're doing the
- * "right" thing here if there is both scaling and translation in
- * the matrix. But for now, the internals guarantee that we won't
- * really ever have both going on. */
+ /* XXX: Support freeform matrices someday (right now, only translation and scale
+ * work. */
_cairo_path_fixed_offset_and_scale (path,
_cairo_fixed_from_double (device_transform->x0),
_cairo_fixed_from_double (device_transform->y0),