Skip to content

The delta from Pointer<Drag> drifts away when dragging a Pickable #20372

@yatinmaan

Description

@yatinmaan

Bevy version

0.16

What you did

Dragged a Pickable.

What went wrong

The values of delta from Pointer<Drag> vs MouseMotion are different when a drag starts on Pickable.
The value via Pointer<Drag> drifts away in the direction of the drag by a constant multiplier of window.scale_factor()/3.0, i.e. the drift vanishes if the window.scale_factor is set to 3.

Additional information

I have a small demo for this, the code for which can be found here: https://github.com/yatinmaan/drag-test

Notice, in the top left, that the Diff (= drag_delta - mouse_motion) stays near zero when I drag outside the Pickable.
But when I start the drag on the Pickable the Diff accumulates error and the Scaled Diff (= drag_delta*window.scale_factor/3 - mouse motion) stays near zero.

drag-test.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-PickingPointing at and selecting objects of all sortsA-UIGraphical user interfaces, styles, layouts, and widgetsC-BugAn unexpected or incorrect behaviorS-Needs-InvestigationThis issue requires detective work to figure out what's going wrong

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions