After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 355520 - Make palette search smarter
Make palette search smarter
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: User Interface
git master
Other All
: Normal enhancement
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2006-09-12 00:24 UTC by david gowers
Modified: 2006-09-12 13:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
improve palette search (2.54 KB, patch)
2006-09-12 00:27 UTC, david gowers
committed Details | Review

Description david gowers 2006-09-12 00:24:39 UTC
Previously, palette searching (used by the context-palette-fore|background-* actions for choosing adjacent palette colors, and eyedropping) would proceed from the start of the palette. This was inconvenient when duplicates of the same color existed in a palette.

The attached patch fixes this, doing a proximity-based search as was always my intention for the palette searching function. It will try to select colors nearest (in terms of position in the palette) to the previously selected color first.
Searching proceeds like this:
...753102468... (where 0 was the previously selected entry). 

 This will usually be more appropriate than searching from the start; related color sets are likely to be grouped together in any human-made palette.

Summary of effected things:
- context-palette-fore|background-* actions
- context-swatch-fore|background-* actions
- eyedropping (effects the attempt to match the eyedropped color to a corresponding palette entry)
Comment 1 david gowers 2006-09-12 00:27:21 UTC
Created attachment 72576 [details] [review]
improve palette search

Tries colors in this kind of order:

The previously selected color, the next color, the previous color, the next next color, the previous previous color......

Changes are only to the gimp_palette_editor_get_index function.
Comment 2 Sven Neumann 2006-09-12 10:36:44 UTC
I hope I didn't break it, but it appeared to me that the whole thing can be simplified a little ...

2006-09-12  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimppaletteeditor.c (gimp_palette_editor_get_index):
	applied a modified patch from David Gowers that changes the search
	behaviour to favour colors in the neighborhood of the selected color
	(bug #355520).
Comment 3 david gowers 2006-09-12 13:14:29 UTC
Seems to work fine. Thanks.