Skip to content

Draggable is not compatible with rotation #60

@GMartigny

Description

@GMartigny

Information

  • Your current navigator: Chrome v76
  • The package and version you used: @pencil.js/[email protected]

Description

When a component is rotated (by itself or any of its parents) the draggable package will produce unexpected result. This impact other package like resizable and Slider that use draggable and prevent them to work when rotated.

A solution might be to climb the component ancestry to compute its absolute rotation and act accordingly in draggable.js.

Reproduce by

const circle = new Circle(scene.center, 200, {
    rotation: 0.25,
    fill: "red",
});

const square = new Square(undefined, 200);
square.draggable();
circle.add(square);

scene.add(circle);

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bugSomething isn't working🙏 help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions