rageworx / fltk-custom

A clone of FLTK 1.4.0 for enhance as customized GUI, more functional. This project is belong to https://fltk.org.
https://rageworx.info
Other
8 stars 1 forks source link

fl_color_chooser() need boundary #57

Closed rageworx closed 1 year ago

rageworx commented 1 year ago

When I call fl_color_chooser() with RGB values, there's no protection for out-ranged values for R/G/B or H/S/V.

image

rageworx commented 1 year ago

As RGB(float) image

rageworx commented 1 year ago

Strange, valuators are set range for these, image

rageworx commented 1 year ago

Test gin out-ranged in Fl_Valuator with Fl_Color_Chooser,

Changed Fl_Valuator.value() set through softclamp() with debugging prints, image

It happens to image

debugging prints as , image

Looks softclamp() is not works ?

rageworx commented 1 year ago

Simply tested to using min,max preprocessor as like this, image

Valuator set to right ranged ( not for step ) image

But still Fl_Color_Chooser appears bad text value, image

rageworx commented 1 year ago

Modifying Fl_Valuator::value() is not right way, need to use Fl_Valuator::clamp() or round() instead value() in Fl_Color_Chooser.

rageworx commented 1 year ago

Follow https://github.com/fltk/fltk/issues/749

rageworx commented 1 year ago

Fixed from fltk-custom and fltk/fltk too.