app: SIOX: algorithm ignores color sensitivity changes

Fix for bug #627062: When changing the color sensitivity settings of
the Foreground Selection Tool, the SIOX algorithm gets called with
refinement=SIOX_REFINEMENT_CHANGE_SENSITIVITY, which then triggers
refinement=SIOX_REFINEMENT_RECALCULATE. However, there is no
implementation for RECALCULATE so the change is ignored. The patch
sets refinement to SIOX_REFINEMENT_ADD_FOREGROUND and _ADD_BACKGROUND
which triggers a complete recalculation.
This commit is contained in:
Enrico Schröder 2011-03-29 23:16:32 +02:00 committed by Michael Natterer
parent 2e406872c4
commit aae8787ee3
1 changed files with 11 additions and 12 deletions

View File

@ -877,25 +877,24 @@ siox_foreground_extract (SioxState *state,
siox_progress_update (progress_callback, progress_data, 0.0);
total = width * height;
if (refinement & SIOX_REFINEMENT_CHANGE_SENSITIVITY)
{
/* trigger complete recalculation */
refinement = (SIOX_REFINEMENT_ADD_BACKGROUND |
SIOX_REFINEMENT_ADD_FOREGROUND);
}
if (refinement & SIOX_REFINEMENT_ADD_FOREGROUND)
g_hash_table_foreach_remove (state->cache, siox_cache_remove_bg, NULL);
if (refinement & SIOX_REFINEMENT_ADD_BACKGROUND)
g_hash_table_foreach_remove (state->cache, siox_cache_remove_fg, NULL);
if (refinement & SIOX_REFINEMENT_CHANGE_SENSITIVITY)
{
refinement = SIOX_REFINEMENT_RECALCULATE;
}
else
{
if (! state->bgsig)
refinement |= SIOX_REFINEMENT_ADD_BACKGROUND;
if (! state->fgsig)
refinement |= SIOX_REFINEMENT_ADD_FOREGROUND;
}
if (! state->bgsig)
refinement |= SIOX_REFINEMENT_ADD_BACKGROUND;
if (! state->fgsig)
refinement |= SIOX_REFINEMENT_ADD_FOREGROUND;
if (refinement & (SIOX_REFINEMENT_ADD_FOREGROUND |
SIOX_REFINEMENT_ADD_BACKGROUND))