[gimp] app: fix coordinates computation when tile-painting with x-shift.



commit c4a87e7a492ce24556c5071c52e618d8eef1e89f
Author: Jehan <jehan girinstud io>
Date:   Sun Feb 7 15:54:10 2016 +0100

    app: fix coordinates computation when tile-painting with x-shift.

 app/core/gimpsymmetry-tiling.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/app/core/gimpsymmetry-tiling.c b/app/core/gimpsymmetry-tiling.c
index 46470c0..f936f43 100644
--- a/app/core/gimpsymmetry-tiling.c
+++ b/app/core/gimpsymmetry-tiling.c
@@ -325,10 +325,13 @@ gimp_tiling_update_strokes (GimpSymmetry *sym,
   height = gimp_item_get_height (GIMP_ITEM (drawable));
 
   if (origin->x > 0 && tiling->max_x == 0)
-    startx = origin->x - tiling->interval_x * (gint) (origin->x / tiling->interval_x + 1)
-             - tiling->shift * (gint) (origin->y / tiling->interval_y + 1);
+    startx = origin->x - tiling->interval_x * (gint) (origin->x / tiling->interval_x + 1);
   if (origin->y > 0 && tiling->max_y == 0)
-    starty = origin->y - tiling->interval_y * (gint) (origin->y / tiling->interval_y + 1);
+    {
+      starty = origin->y - tiling->interval_y * (gint) (origin->y / tiling->interval_y + 1);
+      if (tiling->shift > 0.0)
+        startx -= tiling->shift * (gint) (origin->y / tiling->interval_y + 1);
+    }
   for (y_count = 0, y = starty; y < height + tiling->interval_y;
        y_count++, y += tiling->interval_y)
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]