@carolhmj, here is what I am seeing with the slider control in the PG. There is an interaction happening that isn’t completely clear between thumbWidth, isThumbCircle, and height. If the thumb is not a circle, the height of the thumb is driven by height and the width is driven by thumbWidth. If the thumb is not clamped, you can get a thumb control that is larger than the slider bar (which is what I would expect):
If I turn on thumb clamped, the height of the thumb should clamp to the height of the slider which is height - (2 * barOffset), however it does not take into account the barOffset and clamps to height:
If I enable the thumb as a circle, everything changes. Thumb clamped will now limit the diameter of the circle to what fits within the slider based on height - (2 * barOffset). There are also two circles added to the ends to make the slider fit a circular thumb, but it appears that these added circles don’t respect the alpha value in the bar color.
If I turn off clamp thumb, the circles at the end of the bar disappear, which is probably fine, but I could see wanting the slider bar to be rounded even if the thumb is larger than the slider bar. This may need to be a flag. But the main issue here is the interaction between height and thumbWidth when the thumb is a circle.
You can see that the thumb is larger than the bar, but not quite as large as height. Changing the value for thumbWidth does nothing for the thumb size as you can see here when I double the value to 60 from 30 in the last screen shot:
But when the thumbWidth gets larger than the height of the slider, then the thumb increases in size. However, there is still something going on because with a height of 80px on the slider, I need a thumbWidth of 100px to get close to the height of the control. So there is some interaction between height and thumbWidth when the thumb is a circle that is not obvious.
I would say that the property thumbWidth needs to act based on if the thumb is circular or not. If it is not circular, it works simply as the width of the thumb and the height of the thumb is set by the height of the slider. If the thumb is circular, thumbWidth should set the diameter of the thumb regardless of the slider height.
Then isThumbClamped will act in this way. If not circular, the height of the thumb = height - (2 * barOffset) and the width of the thumb is set by thumbWidth. If circular, the diameter of the thumb is height - (2 * barOffset) and thumbWidth is ignored because the diameter is already set.
I am also seeing some strange behavior on the width of the bar when isThumbClamped is toggled. This is off:
And notice how the bar width changes when isThumbClamped is enabled with the same settings as above:
It seems like there are several bugs interacting here, but some of these may have drastic ripple effects on back compat. Maybe we need to circle with @RaananW and see if there should be a v2 slider control that addresses these concerns while retaining back compat with a deprecated v1 slider.
@Biscuit, I noticed that you are using an ortho camera, but are not handling engine ratio or width/height changes which results in your canvas getting artificially stretched. Here is an example using ortho camera that updates when the window resizes to always keep the render proportional. Anytime you use an ortho camera, you want to handle this use case even in terms of opening your scene on a different monitor ratios. You are only interested in lines 6-28 in this PG.