TriplePlay: irregular, bumpy scrolling

24 vistas
Ir al primer mensaje no leído

Pedro García-Pego Catalá

no leída,
13 oct 2020, 3:56:48 a.m.13/10/20
para PlayN
Hi,

When dragging a Scroller containing interactive elements (such as buttons) the scroll is irregular and bumpy (it moves back and forward even if the displacement is only in one direction). If the buttons are replaced with non-interactive elements (e.g. Labels) this does not happen. This only happens with the last (at the time of writing) published version, namely 2.0.5.

Any hints/workaround available?
I've created an associated issue in GitHub with some sample code attached (https://github.com/threerings/tripleplay/issues/80).

Thanks,
Pedro

Guillermo Rodriguez Garcia

no leída,
23 oct 2020, 8:12:27 a.m.23/10/20
para PlayN
Hi,

I am not sure what is happening here, but if you only see this with 2.0.5 and not with 2.0.4 I would have a look at this PR:


This change was originally introduced because Scroller did not work as expected when the root layer had transforms applied (in my case, 90/180/270 rotations). After some discussion, XYFlicker was modified to use the "local" event coordinates. These are relative to the hit layer's coordinate space and already account for any top-level transformations.

The thing is, if there are no interactive elements, then the hit layer is the Scroller's layer. But if there are interactive elements, the hit layer is the layer of whatever element received the event. Perhaps this is what is causing the problem?

Guillermo

Pedro García-Pego Catalá

no leída,
26 oct 2020, 9:58:02 a.m.26/10/20
para PlayN
Thanks Guillermo,

It's exactly that: the coordinates extracted in XYFlicker.getPosition() (before they are reversed) must be coordinates local to the scroller layer but the current implementation (in 2.0.5 and master at the time of writing) uses coordinates local to the hit layer. The two layers are usually the same unless the scroller contains some interactive elements and the drag interaction is started over one of them.

Responder a todos
Responder al autor
Reenviar
Se borró el mensaje
0 mensajes nuevos