After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 653101 - ClutterDragAction jitters randomly on actors with 45° rotation
ClutterDragAction jitters randomly on actors with 45° rotation
Status: RESOLVED OBSOLETE
Product: clutter
Classification: Platform
Component: ClutterAction
1.6
Other Linux
: Normal normal
: ---
Assigned To: clutter-maint
clutter-maint
: 656894 681862 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-06-21 12:46 UTC by Peter Ward
Modified: 2021-06-10 11:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
program to demonstrate the problem (642 bytes, text/x-python)
2011-06-21 13:09 UTC, Peter Ward
Details

Description Peter Ward 2011-06-21 12:46:14 UTC
Test program to demonstrate the problem is attached.

The issue is that clutter_actor_transform_stage_point is used, but that is not guaranteed to work, and ClutterDragAction doesn't check the return value to see if it worked or not. So, it gets back garbage values, which then are used to move the actor about, causing it to randomly jitter.

I have little idea about how to fix this - is it a problem with clutter_actor_transform_stage_point, that it doesn't deal with this case very well, or should ClutterDragAction do something cleverer?
Comment 1 Emmanuele Bassi (:ebassi) 2011-06-21 13:09:53 UTC
sadly, there isn't much we can do to fix transform_stage_point(): 3D perspective transformations with 2D layers will end up with points that simply cannot be transformed into meaningful values.

DragAction should probably just bail out if transform_stage_point() returns FALSE and not emit a drag-motion signal.
Comment 2 Peter Ward 2011-06-21 13:09:54 UTC
Created attachment 190361 [details]
program to demonstrate the problem
Comment 3 Peter Ward 2011-06-21 14:05:47 UTC
> DragAction should probably just bail out if transform_stage_point() returns
> FALSE and not emit a drag-motion signal.

Unfortunately, it looks like when transform_stage_point() fails, it is due to the actor's position, not the co-ordinates we want to transform - so, unless the actor is otherwise moved, all future calls to t_s_p() will also fail for that actor - resulting in the actor getting stuck.
Comment 4 Emmanuele Bassi (:ebassi) 2011-08-16 15:14:21 UTC
on further investigation, it's not a problem of transform_stage_point(), nor of the moving.

when rotating, we apply a modelview transformation when painting, on top of the allocation; dragging around uses the move_by() method, which uses the allocated position of the actor instead. so, there's a slight disconnect between what we're moving and what happens to the actor while being painted. this evidently leads to non-pixel-aligned positioning that manifest as "jumping".

I honestly don't know how to fix this without changing the meaning and semantics of how ClutterActor works in ways that are not really compatible.
Comment 5 Emmanuele Bassi (:ebassi) 2011-08-19 11:29:36 UTC
*** Bug 656894 has been marked as a duplicate of this bug. ***
Comment 6 Emmanuele Bassi (:ebassi) 2011-08-19 11:31:21 UTC
in bug 656894 it turns out that the effect is greater if the rotation factor is bigger, so it's really the case of "move_by() affects allocation, rotate() affects modelview".
Comment 7 Emmanuele Bassi (:ebassi) 2011-09-26 09:24:28 UTC
one solution would be to sub-class the DragAction and override the drag_motion() virtual function to not use clutter_actor_move_by(), and instead move the actor by taking into account the transformations. this could probably be done in Clutter itself so we wouldn't have to change the move_by() semantics ­— though it would probably be more expensive.
Comment 8 Emmanuele Bassi (:ebassi) 2012-08-14 16:48:01 UTC
*** Bug 681862 has been marked as a duplicate of this bug. ***
Comment 9 Emmanuele Bassi (:ebassi) 2012-08-14 17:03:24 UTC
ClutterDragAction in master has ::drag-progress, which allows overriding the default handler for ::drag-motion, so at least you can have a work-around for actors that are known to be transformed.
Comment 10 André Klapper 2021-06-10 11:31:39 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version of clutter, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a ticket at
  https://gitlab.gnome.org/GNOME/clutter/-/issues/

Thank you for your understanding and your help.