core: Consider filters when selecting by color

When selecting by color with the Fuzzy Selection, Color Selection,
or Bucket Fill tool, we use gimp_pickable_get_buffer (). This only looks
at the raw pixels and not any active filters, which can result in some
unexpected selections (for example, an NDE offset filter will make it
appear as if you are selecting the wrong area).

There are plans to let users decide whether to select the raw
pixels or the filtered layer. For now, this sets the default action to
consider the layer as seen by the user, with filters included in the
calculation.
This commit is contained in:
Alx Sa 2025-02-16 03:09:18 +00:00
parent 414c0132e3
commit 6279d7b70b

View file

@ -144,7 +144,7 @@ gimp_pickable_contiguous_region_by_seed (GimpPickable *pickable,
g_return_val_if_fail (GIMP_IS_PICKABLE (pickable), NULL);
gimp_pickable_flush (pickable);
src_buffer = gimp_pickable_get_buffer (pickable);
src_buffer = gimp_pickable_get_buffer_with_effects (pickable);
format = choose_format (src_buffer, select_criterion,
&n_components, &has_alpha);
@ -222,7 +222,7 @@ gimp_pickable_contiguous_region_by_color (GimpPickable *pickable,
gimp_pickable_flush (pickable);
src_buffer = gimp_pickable_get_buffer (pickable);
src_buffer = gimp_pickable_get_buffer_with_effects (pickable);
format = choose_format (src_buffer, select_criterion,
&n_components, &has_alpha);