Repository navigation
fix: live shape previews, dropdown type-ahead, and mixed fonts in one text layer - #104
Merged
Merged
Conversation
… text layer Closes #99, #100 and #101. Shape tools (#101): the rectangle, ellipse, polygon, line and custom shape tools now show the real shape, fill and all, while it is being dragged out. The preview is the very layer the drag would commit, rebuilt on each move and kept outside history; on release it is re-inserted as the single undoable edit, and cancelling drops it. The old overlay drew a rectangle for every kind. Dropdowns (#100): every dropdown follows the keyboard while open. Typing jumps to the first row starting with what was typed (a pause of a second starts a new word; a letter pressed repeatedly cycles through its rows), the arrows and Home/End walk the rows, Enter picks the highlighted one. The open dropdown publishes its rows through a thread-local the way dialogs publish their default action. The layers panel's hand-rolled blend-mode menu now uses the shared widget. Escape on a dropdown inside a dialog closes the dropdown rather than the dialog. Text layers (#99): `TextSpec` gains `runs`, byte ranges that override the layer's family, style or size, so one layer can mix fonts. The engine resolves one face per distinct style, kerns only within a face, sizes each line to its tallest face and places the caret from the same pass as the glyphs. In the type tool, a selection takes the bar's font, style or size for just those characters; with nothing selected the whole layer changes as before; typing after a styled word continues in it and the bar follows the caret. Plain specs serialize exactly as before, so existing files load unchanged. A new `LayerExtrasSet` history op makes "Edit Text" undo the spec and layer name together with the pixels, which previously drifted apart. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Member
Author
|
seems to fix 101 and 100, 99 still seems broken and linter broke |
Member
Author
|
Addressed the review follow-ups in
Verification:
|
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.
Closes #99, #100 and #101.
Shape tools (#101)
The rectangle, ellipse, polygon, line and custom shape tools now show the real shape, fill and all, while it is being dragged out. The preview is the very layer the drag would commit, rebuilt on each move and kept outside history (
DragPreviewinplugins/tools-vector); on release it is re-inserted as the single undoable edit, and cancelling or switching tool drops it. The old overlay drew a rectangle for every kind.Dropdowns (#100)
Every dropdown follows the keyboard while open: typing jumps to the first row starting with what was typed (a one-second pause starts a new word; a letter pressed repeatedly cycles through its rows), Up/Down/Home/End walk the rows, Enter picks the highlighted one. The open dropdown publishes its rows through a thread-local the way dialogs publish their default action (
ui::open_dropdown). The layers panel's hand-rolled blend-mode menu now uses the shared widget. Escape on a dropdown inside a dialog now closes the dropdown rather than the whole dialog.Text layers (#99)
TextSpecgainsruns: byte ranges that override the layer's family, style or size, so one layer can mix fonts. The engine resolves one face per distinct style, kerns only within a face, sizes each line to its tallest face and places the caret from the same pass as the glyphs. In the type tool a selection takes the bar's font, style or size for just those characters; with nothing selected the whole layer changes as before; typing after a styled word continues in it, and the bar follows the caret. Plain specs serialize byte-for-byte as before, so existing files load unchanged. A newLayerExtrasSethistory op makes "Edit Text" undo the spec and layer name together with the pixels (they previously drifted apart after an undo).Verification
cargo check --workspace --all-targetsclean; tests pass inschist-core,schist-text-engine,schist-tools-vector,schist-tools-typeandschist-app(new tests for each feature).min the blend menu jumps to Multiply, Down + Enter commits Color Burn;bpicks Bold andd/dd/dddcycle the DejaVu families in the font menu; "hi there" renders with "there" in a different family on one layer.Left out
🤖 Generated with Claude Code