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 bec2449b87..f9e0c0c766 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 a639d646fa..93f2f77479 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 72d2b0ee11..9540a73921 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 -
-offset-dialog -offset_dialog_new -
-
palette-import-dialog palette_import_dialog_new