inconsistency in processing scroll events with hidpi/retina

Johan Vos johan.vos at gluonhq.com
Tue Sep 8 12:14:17 UTC 2015


Hi,

I am running into an issue on Android that seems more general to me.
I noticed that scroll gestures where passed with wrong coordinates, as
the physical coordinates are used instead of the logical (e.g. on a
screen with a density/scalefactor of 3, we would pass x = 900 instead
of x = 300).

Debugging it shows that
scene.sceneListener.scrollEvent()

can be called from 2 different paths:
GlassViewEventHandler.handleScrollEvent()
and
ScrollGestureRecognizer.sendScrollStartedEvent

In the GlassViewEventHandler.handleScrollEvent, coordinates are
transformed before sending to the scrollEvent method:

(w being the Window)
double pScale = (w == null) ? 1.0 : w.getPlatformScale();
and the x and y coordinates are replaced with x/pScale and y/pScale

However, this doesn't happen in the ScrollGestureRecognizer, so the
coordinates that this one sent to the scrollEvent method are not
corrected by with the scale factor.

- Johan


More information about the openjfx-dev mailing list