Skip to content

Improve Drag and Drop #80

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Apr 8, 2025
Merged

Conversation

thecoolwinter
Copy link
Contributor

@thecoolwinter thecoolwinter commented Apr 7, 2025

Description

Improves the drag and drop capabilities of the editor.

In particular:

  • Adds a new DraggingTextRenderer that renders text into itself using knowledge of existing text layout to match text while being dragged.
  • Overrides drag and drop methods on the text view to correctly support the gesture.
  • Moves line fragment drawing logic into the LineFragment class instead of LineFragmentView to enable drawing contents into whatever drawing target is necessary.

Related Issues

Checklist

TODO:

  • Drag text without background
  • Cursor updates to indicate drag destination location.
  • Modifier flags
    • Hold option to copy instead of cut
    • Escape to cancel
  • I read and understood the contributing guide as well as the code of conduct
  • The issues this PR addresses are related to each other
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • My changes are all related to the related issue above
  • I documented my code

Screenshots

Screen.Recording.2025-04-07.at.3.51.19.PM.mov

@thecoolwinter thecoolwinter marked this pull request as draft April 7, 2025 20:21
@thecoolwinter thecoolwinter changed the title Drag and Drop Selected Text Improve Drag and Drop Apr 7, 2025
@thecoolwinter thecoolwinter marked this pull request as ready for review April 7, 2025 21:01
@thecoolwinter thecoolwinter merged commit 82bc832 into CodeEditApp:main Apr 8, 2025
2 checks passed
@thecoolwinter thecoolwinter deleted the fix/drag-image branch April 8, 2025 14:35
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.

✨ Drag and Drop Selected Text
1 participant