You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With notation 1 ("x"), dat.GUI will ignore step completely (as evidenced in the console output). With notation 2 ("y"), step will be respected for value changes, but precision in the NumberControllerBox is wrong.
I followed the path into the dat.GUI code, and I believe it's a problem with the factory which only supplies max and min values to NumberControllerSlider and NumberControllerBox and throws away step. In notation 1, step will never be seen by any controller. In notation 2, the step setter function will adjust the value for the Slider, but the change does not propagate to the Box.
I've crudely added step to the factory like so (argument[4]):
if(common.isNumber(arguments[2])&&common.isNumber(arguments[3])){// Has min and max.returnnewNumberControllerSlider(object,property,arguments[2],arguments[3],arguments[4]);}else{returnnewNumberControllerBox(object,property,{min: arguments[2],max: arguments[3],step: arguments[4]});}
This fixes the problem for notation 1 in my example (notation 2 would still need to update the Slider's display NumberControllerBox from the step setter), but I'm sure there need to be checks built around it, and I'm simply not confident enough in my ability to catch everything to submit a PR.
Perhaps you can help?
The text was updated successfully, but these errors were encountered:
I add two GUIs like so:
With notation 1 ("x"), dat.GUI will ignore step completely (as evidenced in the console output). With notation 2 ("y"), step will be respected for value changes, but precision in the NumberControllerBox is wrong.
I followed the path into the dat.GUI code, and I believe it's a problem with the factory which only supplies max and min values to NumberControllerSlider and NumberControllerBox and throws away step. In notation 1, step will never be seen by any controller. In notation 2, the step setter function will adjust the value for the Slider, but the change does not propagate to the Box.
I've crudely added step to the factory like so (argument[4]):
This fixes the problem for notation 1 in my example (notation 2 would still need to update the Slider's display NumberControllerBox from the step setter), but I'm sure there need to be checks built around it, and I'm simply not confident enough in my ability to catch everything to submit a PR.
Perhaps you can help?
The text was updated successfully, but these errors were encountered: