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.
This commit is contained in:
Alx Sa 2026-02-09 12:17:11 +00:00
parent 9ea1b90e45
commit f08eff5cda

View file

@ -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);
}
}