Repository navigation
Feat/inline text editing - #899
Open
saif-ellafi wants to merge 9 commits into
Open
saif-ellafi wants to merge 9 commits into
saif-ellafi wants to merge 9 commits into
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
- A new inline text is one undo step; Escape or empty text drops it without leaving a placeholder layer or a redo step. - An edit that changes nothing records no history step. - A tap outside that saves no longer swallows the next drag, and a drag that starts on the text keeps selecting text. - Undo, redo and every sub-editor save an open edit first; removing the edited layer ends the edit. - Editing the layer being typed into keeps the session; its context menu is left to the field. - Clicks on the layer padding, its handles or a format bar keep the focus in the text on desktop. - A format bar outside the editor no longer keeps blocking the next tap outside. - New inline texts wrap like texts from the text editor; a boxed field ignores the platform text scale like the painted layer. - Add an inline text editing example, the CHANGELOG entry and version 14.16.0.
Owner
|
Thanks a lot for the PR, @saif-ellafi! 🙌 I tested it in the example and in the editor, and everything worked flawlessly. I added a small follow-up commit on top:
It will be released in 14.16.0. |
Contributor
Author
|
That's a milestone! The library is getting so much more convenient for desktop use now! I even made a PDF Form Fillables -> PIE : leveraging sized text boxes and in-line editing becomes very useful for tabletop gaming use ^^ |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello, this is a follow up feature proposition to allow in-line TextLayer editing.
This PR has been AI-Assisted and is rebased from the Stable containing boxed TextLayers.
These two would improve significantly the capabilities across platforms for editing text conveniently.
Description
Adds an opt-in way to type into a text layer on the canvas.
TextEditorConfigs.enableInlineEditingdefaults tofalse. Until a host sets it totrue,editTextLayerandopenTextEditorstill open the full-screenTextEditor, and editor keyboard shortcuts are unchanged.When a host turns it on, the layer becomes a text field at its current size, scale, and optional text box. The edit is written once, on done, Ctrl/Cmd+Enter, or a click outside the layer. Escape cancels it and leaves the layer as it was. Empty text removes the layer. Done, image capture, layer capture, and history export commit an open edit before they read the layer, and they wait until the field has left the tree. While a session is open, editor shortcuts do not rotate, scale, or undo the layer, and Escape cancels the session instead of closing the editor.
Related Issue: Closes #
Type of Change