[gimp/gimp-2-10] app: various fixes/cleanups to last commits



commit 175e3ea7d909e2a768854e8c7fcba6e9f08cf9c1
Author: Ell <ell_se yahoo com>
Date:   Thu Jun 6 02:20:27 2019 -0400

    app: various fixes/cleanups to last commits
    
    (cherry picked from commit 30429e30e27f5a82d067550509a023bb221cdd47)

 app/core/gimpdrawable-offset.c       | 17 +++++++++++++++++
 app/operations/gimpoperationoffset.c | 10 ++++++++--
 app/widgets/gimphelp-ids.h           |  1 -
 devel-docs/app/app-sections.txt      |  5 -----
 4 files changed, 25 insertions(+), 8 deletions(-)
---
diff --git a/app/core/gimpdrawable-offset.c b/app/core/gimpdrawable-offset.c
index 0c4d1ea616..58089c5da5 100644
--- a/app/core/gimpdrawable-offset.c
+++ b/app/core/gimpdrawable-offset.c
@@ -43,13 +43,30 @@ gimp_drawable_offset (GimpDrawable   *drawable,
                       gint            offset_y)
 {
   GeglNode *node;
+  gint      width;
+  gint      height;
 
   g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
   g_return_if_fail (GIMP_IS_CONTEXT (context));
 
+  if (! gimp_item_mask_intersect (GIMP_ITEM (drawable),
+                                  NULL, NULL, &width, &height))
+    {
+      return;
+    }
+
   if (wrap_around)
     fill_type = GIMP_OFFSET_WRAP_AROUND;
 
+  if (fill_type == GIMP_OFFSET_WRAP_AROUND)
+    {
+      offset_x %= width;
+      offset_y %= height;
+    }
+
+  if (offset_x == 0 || offset_y == 0)
+    return;
+
   node = gegl_node_new_child (NULL,
                               "operation", "gimp:offset",
                               "context", context,
diff --git a/app/operations/gimpoperationoffset.c b/app/operations/gimpoperationoffset.c
index 6a6114be03..c3d2c580f6 100644
--- a/app/operations/gimpoperationoffset.c
+++ b/app/operations/gimpoperationoffset.c
@@ -26,6 +26,7 @@
 
 #include "operations-types.h"
 
+#include "gegl/gimp-gegl-loops.h"
 #include "gegl/gimp-gegl-utils.h"
 
 #include "core/gimpcontext.h"
@@ -376,8 +377,8 @@ gimp_operation_offset_process (GeglOperation       *operation,
               offset_roi.x -= offset_x;
               offset_roi.y -= offset_y;
 
-              gegl_buffer_copy (input,  &offset_roi, GEGL_ABYSS_NONE,
-                                output, &offset_bounds);
+              gimp_gegl_buffer_copy (input,  &offset_roi, GEGL_ABYSS_NONE,
+                                     output, &offset_bounds);
             }
           else if (color)
             {
@@ -430,6 +431,11 @@ gimp_operation_offset_get_offset (GimpOperationOffset *offset,
       if (*y < 0)
         *y += bounds.height;
     }
+  else
+    {
+      *x = CLAMP (*x, -bounds.width,  +bounds.width);
+      *y = CLAMP (*y, -bounds.height, +bounds.height);
+    }
 }
 
 static void
diff --git a/app/widgets/gimphelp-ids.h b/app/widgets/gimphelp-ids.h
index 1b9eb8360f..e862128540 100644
--- a/app/widgets/gimphelp-ids.h
+++ b/app/widgets/gimphelp-ids.h
@@ -218,7 +218,6 @@
 #define GIMP_HELP_LAYER_ROTATE_90                 "gimp-layer-rotate-90"
 #define GIMP_HELP_LAYER_ROTATE_180                "gimp-layer-rotate-180"
 #define GIMP_HELP_LAYER_ROTATE_270                "gimp-layer-rotate-270"
-#define GIMP_HELP_LAYER_OFFSET                    "gimp-layer-offset"
 #define GIMP_HELP_LAYER_RESIZE                    "gimp-layer-resize"
 #define GIMP_HELP_LAYER_RESIZE_TO_IMAGE           "gimp-layer-resize-to-image"
 #define GIMP_HELP_LAYER_SCALE                     "gimp-layer-scale"
diff --git a/devel-docs/app/app-sections.txt b/devel-docs/app/app-sections.txt
index e52d90642e..692435f370 100644
--- a/devel-docs/app/app-sections.txt
+++ b/devel-docs/app/app-sections.txt
@@ -11879,11 +11879,6 @@ image_scale_dialog_new
 module_dialog_new
 </SECTION>
 
-<SECTION>
-<FILE>offset-dialog</FILE>
-offset_dialog_new
-</SECTION>
-
 <SECTION>
 <FILE>palette-import-dialog</FILE>
 palette_import_dialog_new


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