RFR: 8303038: Glass gtk3 sends scroll events with delta(x, y) = 0 [v4]

Andy Goryachev angorya at openjdk.org
Wed Mar 1 16:14:29 UTC 2023


On Wed, 1 Mar 2023 16:03:06 GMT, Thiago Milczarek Sayao <tsayao at openjdk.org> wrote:

>> modules/javafx.graphics/src/main/native-glass/gtk/glass_window.cpp line 419:
>> 
>>> 417:         // Note: For gtk negatives values means UP/LEFT, JavaFx is opposite
>>> 418:         dx = (dx != 0) ? dx * -1 : 0;
>>> 419:         dy = (dy != 0) ? dy * -1 : 0;
>> 
>> Is avoiding a possible negative 0 is really necessary? If not, this could simplify to `dx *= -1;` and `dy *= -1;`
>
> Will double check it, but I think I spaced out.

dx = (dx != 0) ? -dx : 0;

also, is jdouble a floating point type?  if so, would that work correctly if dx/dy are very small?

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

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


More information about the openjfx-dev mailing list