From f08eff5cdacf3edb0021a8ebcd5570d69cd80779 Mon Sep 17 00:00:00 2001 From: Alx Sa Date: Mon, 9 Feb 2026 12:17:11 +0000 Subject: [PATCH] core: Retain SamplePoint modes when copying images Resolves #15833 When we copied images in gimp_image_duplicate_sample_points (), we only carried over their X & Y position, not their pick mode. This patch adds calls to get the original pick mode and to set it to the new sample point created in the copied image. --- app/core/gimpimage-duplicate.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/app/core/gimpimage-duplicate.c b/app/core/gimpimage-duplicate.c index 333b7758ad..b400ebd595 100644 --- a/app/core/gimpimage-duplicate.c +++ b/app/core/gimpimage-duplicate.c @@ -500,13 +500,19 @@ gimp_image_duplicate_sample_points (GimpImage *image, list; list = g_list_next (list)) { - GimpSamplePoint *sample_point = list->data; - gint x; - gint y; + GimpSamplePoint *sample_point = list->data; + GimpSamplePoint *new_sample_point; + GimpColorPickMode pick_mode; + gint x; + gint y; gimp_sample_point_get_position (sample_point, &x, &y); + pick_mode = gimp_sample_point_get_pick_mode (sample_point); - gimp_image_add_sample_point_at_pos (new_image, x, y, FALSE); + new_sample_point = gimp_image_add_sample_point_at_pos (new_image, x, y, + FALSE); + gimp_image_set_sample_point_pick_mode (new_image, new_sample_point, + pick_mode, FALSE); } }