Min/Max valueまたはMin/Max slider valueどちらかで、"最小最大を両方"設定すると、値変化の挙動が変わってしまいます。
私たちは、"最小最大を両方"設定しつつ、その挙動は変えたくないため、問題になっています。
"最小最大を両方"設定しつつ、していない場合と同じ挙動を再現する方法を教えていただけますでしょうか?
私たちは、UMGではなくC++で、UEditorUtilityWidgetを継承したクラスにてSpinboxなどを制御しています。
また、エンジンコードのEngine/Source/Runtime/Slate/Public/Widgets/Input/SSpinBox.hのL594でSpinRangeの制限ありかなしかを判定していそうな箇所までは特定しています。
デフォルトの設定がない状態では値の大きさ(桁数?)にスライダーの1つ分の変化量が比例する形となっていますが、両方設定を行うと最小最大の範囲内で線形変化するような挙動となります。
添付画像では、マウスを同じ距離だけ動かしたときに、最小最大値を設定した場合(上)としていない場合(下)の比較しています。
再現手順
Min/Max valueまたはMin/Max slider valueどちらかで、"最小最大を両方"設定すると、値変化の挙動が変わってしまいます。
私たちは、"最小最大を両方"設定しつつ、その挙動は変えたくないため、問題になっています。
"最小最大を両方"設定しつつ、していない場合と同じ挙動を再現する方法を教えていただけますでしょうか?
私たちは、UMGではなくC++で、UEditorUtilityWidgetを継承したクラスにてSpinboxなどを制御しています。
また、エンジンコードのEngine/Source/Runtime/Slate/Public/Widgets/Input/SSpinBox.hのL594でSpinRangeの制限ありかなしかを判定していそうな箇所までは特定しています。
デフォルトの設定がない状態では値の大きさ(桁数?)にスライダーの1つ分の変化量が比例する形となっていますが、両方設定を行うと最小最大の範囲内で線形変化するような挙動となります。
添付画像では、マウスを同じ距離だけ動かしたときに、最小最大値を設定した場合(上)としていない場合(下)の比較しています。
こちらの質問ですが、min/maxを設定せずspinboxの外側で値をチェックする方式として回避することにしました。
お騒がせし大変申し訳ございませんが、質問はこのままクローズしていただいて構いません。
Hi [岡田 [Content removed]
I see you already settled for a solution that suits your needs.
In any case, allow me to share some extra information about the spinbox in case it is useful for you or somebody else that comes across this topic.
As you probably have guessed, the behavior you observed is by design: by default, the spinbox increases linearly when its minimum and maximum values are set, and exponentially otherwise. If you need to have the exact same exponential behavior of the unbounded spinbox, but constrained within a range, I’d say that the best approach is indeed to force the limits on the client code. Another possibility would be for the client code to map a linear value coming from the bounded spinbox to the desired exponential value needed elsewhere.
That said, note that the spinbox has some useful hidden features: for example, you can make it spin 10 times faster by holding down the shift key while dragging, or 10 times slower by holding down the control key.
Moreover, in C++, you have several configuration options which might not have been exported to UMG. In particular, you can change the “SliderExponent” attribute to make the spin behavior exponential even when a range is set, and you can set the “SliderExponentNeutralValue” to define the value around which you’d like the user to have the most precision (instead of zero). On the other hand, in my tests here, I was not able to use these settings to reproduce the exact same exponential behavior of the unbounded spinbox, so you might be better off with your current solution, depending on your needs.
I hope this was informative. If you don’t need any further assistance, I’ll close this topic in a few days.
Best regards,
Vitor