| [ Return to Bugs & Features | Roadmap 2.0 | Post Text | Post File ]
STR #2035
Application: | FLTK Library |
Status: | 5 - New |
Priority: | 1 - Request for Enhancement, e.g. asking for a feature |
Scope: | 3 - Applies to all machines and operating systems |
Subsystem: | Unassigned |
Summary: | Getting odd slider values |
Version: | 2.0-feature |
Created By: | bhb2048 |
Assigned To: | Unassigned |
Fix Version: | Unassigned |
Update Notification: | |
Trouble Report Files:
[ Post File ]No files
Trouble Report Comments:
[ Post Text ]
|
#1 | bhb2048 13:03 Sep 05, 2008 |
| I wanted a slider that would only have odd integer values (for setting a gaussian kernel size). I set minimum=3 and maximum=11, step=2, linesize=2. But when using it, the values were even (multiples of step).
This can be changed by modifying handle_drag() in Valuator.cxx as follows:
Current: void Valuator::handle_drag(double v) { // round to nearest multiple of step: if (step_ >= 1) { v = rint(v/step_)*step_;
Modified: void Valuator::handle_drag(double v) { // round to nearest multiple of step: if (step_ >= 1) { v = rint((v-minimum_)/step_)*step_ + minimum_;
This way both even & odd work.
Cheers, Barry | |
[ Return to Bugs & Features | Post Text | Post File ]
|
| |