Skip to content

Konva.Stage pointer capture does not allow creating shapes that extend beyond stage boundaries #1992

@GeoffCox

Description

@GeoffCox

I want to create a new rectangle and allow the user to pick a starting point and drag to size the rectangle.

Repro:

  1. Create a stage with a size smaller than the page.
  2. Wire up pointerdown, pointermove, pointerup events.
  3. On pointer down, create a shape and add it to the stage. Capture the pointer.
  4. On pointer move, resize the shape based on the pointer movement. Ensure it has the pointer capture.
  5. On pointer up, release the pointer.

Expected:
Like pointer capture on HTML elements, would continue to get pointer move events even when pointer is outside the stage.

Actual:

  1. Shape is resized as the pointer moves within the stage.
  2. Shape stops resizing if the pointer moves outside stage bounds.
  3. Once pointer moves back within stage bounds, resizing continues.
  4. If the mouse up is outside the stage bounds the on pointer up is never called.

Note: The Transformer allows dragging handles outside the stage boundaries and works great, but I can't find a way using stage to do the same thing with the pointer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions