Skip to content

Conversation

@erik-balfe
Copy link

Summary

Adds dragOutside option to the drag plugin that allows dragging to continue when the mouse pointer leaves the canvas or browser window.

Changes

  • Add dragOutside?: boolean option to drag plugin (default: false)
  • Implement document-level event handlers for tracking mouse movement outside canvas
  • Fix coordinate system handling between PIXI and DOM coordinates
  • Prevent conflicts between normal drag and dragOutside modes
  • Add comprehensive test coverage
  • Integrate option into demo controls panel

Use Case

Useful for applications where users frequently drag over browser UI elements or across multiple windows. Prevents accidental drag termination when cursor leaves canvas boundaries.

Testing

  • Manual testing confirmed drag continues when mouse leaves window/canvas
  • All existing tests pass
  • Added automated tests for option handling and event setup

Backward Compatibility

Fully backward compatible - new option defaults to false.

…anvas

- Add dragOutside option to drag plugin (default: false)
- Implement document-level event handlers for tracking mouse outside canvas
- Fix coordinate system handling between PIXI and DOM coordinates
- Add comprehensive test coverage and demo integration
- Maintain full backward compatibility

Useful for applications where users drag over browser UI elements or across multiple windows.
@erik-balfe erik-balfe force-pushed the feature/drag-outside branch from 4f2fe30 to 730a2bf Compare June 18, 2025 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant