On Sun, 24 Mar 2024 15:11:16 GMT, drmarmac <d...@openjdk.org> wrote:

> This PR should fix the issue and cover all relevant cases with new tests.
> 
> Note: This involves a small behavior change, as can be seen in 
> dblSpinner_testWrapAround_decrement_twoSteps() in SpinnerTest.java:749. With 
> this change the wraparound behavior is similar to that of the IntegerSpinner.

I see these possible definitions for the double spinner behavior with 
wraparound:
1) Current PR: Wraparound uses amountToStepBy amount, formula: MOD (max - min + 
amountToStepBy)
2) Make it behave like the integer spinner, meaning the wraparound is always a 
step size of 1, formula: MOD (max - min + 1)
3) Calculate MOD (max - min), which would make the upper limit non-inclusive 
(i.e. it will never be reached).
4) Calculate MOD (max - min) only when > max, i.e. allow the maximum, but 
calculate like it's the same as the minimum, meaning stepping directly from max 
to min and vice versa is usually not possible. Also, both max and min values 
will only be reachable from one direction.
Looking at this again, maybe 4) is actually preferable?

-------------

PR Comment: https://git.openjdk.org/jfx/pull/1431#issuecomment-2028327545

Reply via email to