[gimp] app: SIOX: algorithm ignores color sensitivity changes
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: SIOX: algorithm ignores color sensitivity changes
- Date: Wed, 30 Mar 2011 17:39:32 +0000 (UTC)
commit aae8787ee338b929cda20bca90c688ccaf6ddbc4
Author: Enrico Schröder <enni schroeder gmail com>
Date: Tue Mar 29 23:16:32 2011 +0200
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.
app/base/siox.c | 23 +++++++++++------------
1 files changed, 11 insertions(+), 12 deletions(-)
---
diff --git a/app/base/siox.c b/app/base/siox.c
index 54314c6..d690258 100644
--- a/app/base/siox.c
+++ b/app/base/siox.c
@@ -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))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]