Commit d03109ae authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Less flickery colour picker when the dragged value hasn't changed

Only call value_changed_fn when the value has changed during null poll events, in line with the check for change logic in Increment().
Note that steppable_set_value() still sends one event per call as mentioned in the cautionary note at line 535, so when called programmatically the behaviour is unchanged.

Tested on a Raspberry Pi, no more shimmering colour swatches.

Version 0.55. Tagged as 'Picker-0_55'
parent 5dd8449e
......@@ -199,8 +199,15 @@ static os_error *Set_Position (steppable_s s, os_coord *pos,
pos->y + window_state.yscroll - window_state.visible.y1,
track_state.icon.extent.y0, track_state.icon.extent.y1);
if ((error = Set_Value (s, value)) != NULL)
goto finish;
if (value != s->steppable.value)
{ if ((error = Set_Value (s, value)) != NULL)
goto finish;
tracef ("steppable calling value_changed_fn\n");
if ((error = (*s->steppable.value_changed_fn) (s, value,
s->dragging, s->steppable.handle)) != NULL)
goto finish;
}
if (start_drag)
{ wimp_drag drag;
......@@ -225,11 +232,6 @@ static os_error *Set_Position (steppable_s s, os_coord *pos,
s->dragging = TRUE;
}
tracef ("steppable calling value_changed_fn\n");
if ((error = (*s->steppable.value_changed_fn) (s, value, s->dragging,
s->steppable.handle)) != NULL)
goto finish;
finish:
return error;
}
......
/* (0.54)
/* (0.55)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.54
#define Module_MajorVersion_CMHG 0.55
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 07 Aug 2013
#define Module_Date_CMHG 12 Jan 2014
#define Module_MajorVersion "0.54"
#define Module_Version 54
#define Module_MajorVersion "0.55"
#define Module_Version 55
#define Module_MinorVersion ""
#define Module_Date "07 Aug 2013"
#define Module_Date "12 Jan 2014"
#define Module_ApplicationDate "07-Aug-13"
#define Module_ApplicationDate "12-Jan-14"
#define Module_ComponentName "Picker"
#define Module_ComponentPath "castle/RiscOS/Sources/Video/UserI/Picker"
#define Module_FullVersion "0.54"
#define Module_HelpVersion "0.54 (07 Aug 2013)"
#define Module_LibraryVersionInfo "0:54"
#define Module_FullVersion "0.55"
#define Module_HelpVersion "0.55 (12 Jan 2014)"
#define Module_LibraryVersionInfo "0:55"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment