RFR: JDK-8298060: Fix precision bug in gesture recognizer classes

Andy Goryachev angorya at openjdk.org
Mon Dec 12 22:29:55 UTC 2022


On Mon, 12 Dec 2022 22:15:46 GMT, John Hendrikx <jhendrikx at openjdk.org> wrote:

>> That would be equivalent yes.
>> 
>> Perhaps it is because `timePassed` was a `double` before measured in seconds while I'm now doing the calculation with nano seconds?
>
> Okay I see what you're getting at, your first suggestion would not be correct, it's supposed to be what you suggest in the 2nd one.  So what I want is:
> 
>      (scrollMagnitude / nanosPassed) * NANOS_TO_SECONDS
> 
> or:
> 
>      (scrollMagnitude * NANOS_TO_SECONDS) / nanosPassed
> 
> ...but that's the same as what I wrote.

I just needed you to confirm that this is indeed correct.

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

PR: https://git.openjdk.org/jfx/pull/966


More information about the openjfx-dev mailing list