[gimp] app: For clone tool, pattern source, use the pattern center



commit c2b643d0436c774a07ab5b9528b9dce6bda435cf
Author: Joao S. O. Bueno <gwidion gmail com>
Date:   Thu Apr 20 00:33:44 2017 -0300

    app: For clone tool, pattern source, use the pattern center
    
    Spotted by José Americo Gobbo: when using a pattern source
    for the clone tool, the top left corner was picked
    as starting control point, which made the "fixed" aligment
    rather useless. Using the pattern center allows the
    better control of a pattern source.

 app/paint/gimpclone.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/app/paint/gimpclone.c b/app/paint/gimpclone.c
index 78a24b0..47259c4 100644
--- a/app/paint/gimpclone.c
+++ b/app/paint/gimpclone.c
@@ -202,6 +202,9 @@ gimp_clone_motion (GimpSourceCore   *source_core,
       GimpPattern *pattern    = gimp_context_get_pattern (context);
       GeglBuffer  *src_buffer = gimp_pattern_create_buffer (pattern);
 
+      src_offset_x += gegl_buffer_get_width (src_buffer) / 2;
+      src_offset_y += gegl_buffer_get_height (src_buffer) / 2;
+
       gegl_buffer_set_pattern (paint_buffer,
                                GEGL_RECTANGLE (paint_area_offset_x,
                                                paint_area_offset_y,


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