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

John Hendrikx jhendrikx at openjdk.org
Mon Dec 12 22:11:02 UTC 2022


On Mon, 12 Dec 2022 22:05:44 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> I think it's correct, unless you have reason to believe why it wouldn't be.  `scrollMagnitude` is a double, and the division and multiplication that follow it will be all done as doubles.
>
> your change is equivalent to 
> 
> (scrollMagnitude * NANOS_TO_SECONDS) / nanosPassed
> 
> is that correct?

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?

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

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


More information about the openjfx-dev mailing list