[gimp] Revert "app: Remove obsolete way of keeping track of last painted dab"



commit 79dfee2c9ea3db1f6a12246b005a3fc57fb9b40a
Author: Alexia Death <alexiadeath gmail com>
Date:   Sun Sep 11 22:31:59 2011 +0300

    Revert "app: Remove obsolete way of keeping track of last painted dab"
    
    This reverts commit 1b62a7bff3e4d9f2e141b87ef3403ac902310074.

 app/paint/gimpbrushcore.c |    5 +++--
 app/paint/gimppaintcore.c |    7 +++++++
 2 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/app/paint/gimpbrushcore.c b/app/paint/gimpbrushcore.c
index 7e834a9..ca7c91e 100644
--- a/app/paint/gimpbrushcore.c
+++ b/app/paint/gimpbrushcore.c
@@ -665,8 +665,8 @@ gimp_brush_core_interpolate (GimpPaintCore    *paint_core,
            */
           s0 += direction;
         }
-      else if (x == (gint) floor (last_coords.y) &&
-               y == (gint) floor (last_coords.y))
+      else if (x == (gint) floor (paint_core->last_paint.x) &&
+               y == (gint) floor (paint_core->last_paint.y))
         {
           /*  Exception B: If first stripe's brush position is within the
            *  same pixel square as the last plot of the previous line,
@@ -774,6 +774,7 @@ gimp_brush_core_interpolate (GimpPaintCore    *paint_core,
   current_coords.velocity = last_coords.velocity + delta_velocity;
 
   gimp_paint_core_set_current_coords (paint_core, &current_coords);
+  gimp_paint_core_set_last_coords (paint_core, &current_coords);
 
   paint_core->distance   = total;
   paint_core->pixel_dist = pixel_initial + pixel_dist;
diff --git a/app/paint/gimppaintcore.c b/app/paint/gimppaintcore.c
index 3783df2..7aa39c2 100644
--- a/app/paint/gimppaintcore.c
+++ b/app/paint/gimppaintcore.c
@@ -322,6 +322,13 @@ gimp_paint_core_paint (GimpPaintCore    *core,
                              paint_state, time))
     {
 
+      if (paint_state == GIMP_PAINT_STATE_MOTION)
+        {
+          /* Save coordinates for gimp_paint_core_interpolate() */
+          core->last_paint.x = core->cur_coords.x;
+          core->last_paint.y = core->cur_coords.y;
+        }
+
       core_class->paint (core, drawable,
                          paint_options,
                          &core->cur_coords,



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