[cairo-commit] src/cairo-path-fixed.c
Vladimir Vukicevic
vladimir at kemper.freedesktop.org
Mon Aug 20 17:35:25 PDT 2007
src/cairo-path-fixed.c | 22 ++++++++--------------
1 file changed, 8 insertions(+), 14 deletions(-)
New commits:
diff-tree f97bb5613a7fb3d92f2d730460f9c721ee13a41a (from 51b6cca8de3181d7b42b612ff491451c765d5811)
Author: Vladimir Vukicevic <vladimir at pobox.com>
Date: Mon Aug 20 17:32:05 2007 -0700
Fix path_fixed_offset_and_scale to apply scale and offset in right order
diff --git a/src/cairo-path-fixed.c b/src/cairo-path-fixed.c
index 89380d3..86c771e 100644
--- a/src/cairo-path-fixed.c
+++ b/src/cairo-path-fixed.c
@@ -513,17 +513,13 @@ _cairo_path_fixed_offset_and_scale (cair
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 (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 += offy;
- } else {
- buf->points[i].y = _cairo_fixed_mul (buf->points[i].y + offy, scaley);
- }
+ 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 (cair
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),
More information about the cairo-commit
mailing list