From d697c0bdb9de5b2bb5b5572b8a04a4751b1947f9 Mon Sep 17 00:00:00 2001 From: Massimo Valentini Date: Tue, 19 Jul 2011 13:00:07 +0200 Subject: [PATCH] app/core: do not offset cairo_path_data_t's headers Stroking a rectangular selection doesn't work, for example. --- app/core/gimpbezierdesc.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/core/gimpbezierdesc.c b/app/core/gimpbezierdesc.c index 572498fa25..03ea2f0aec 100644 --- a/app/core/gimpbezierdesc.c +++ b/app/core/gimpbezierdesc.c @@ -168,15 +168,16 @@ gimp_bezier_desc_translate (GimpBezierDesc *desc, gdouble offset_x, gdouble offset_y) { - gint i; + gint i, j; g_return_if_fail (desc != NULL); - for (i = 0; i < desc->num_data; i++) - { - desc->data[i].point.x += offset_x; - desc->data[i].point.y += offset_y; - } + for (i = 0; i < desc->num_data; i += desc->data[i].header.length) + for (j = 1; j < desc->data[i].header.length; ++j) + { + desc->data[i+j].point.x += offset_x; + desc->data[i+j].point.y += offset_y; + } } GimpBezierDesc *