Add markup layers and tools to screenshot editor#777
Merged
multiplex55 merged 9 commits intomasterfrom Feb 1, 2026
Merged
Conversation
Replaces the previous text input UI with an in-canvas text editing experience. Introduces an ActiveText struct to manage ephemeral text state, allowing users to click to place text and type directly onto the screenshot. Commits or cancels text on Enter or Escape, and ensures each text instance captures its color and size at creation.
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.
Motivation
Description
MarkupLayermodel and supporting types (MarkupStroke,MarkupRect,MarkupArrow,MarkupHistory) and rendering helpers insrc/gui/screenshot_editor.rs, includingrender_markup_layersand simple raster primitives (draw_line,draw_circle, blending).ScreenshotEditorto storehistory: MarkupHistoryand transient state for active strokes/shape creation, addedtool,color_index, andthicknessfields, and updatedapply_edits()to render markup layers first then apply cropping (src/gui/screenshot_editor.rs).[/]key handlers) and undo/redo buttons and shortcuts in the editor UI (src/gui/screenshot_editor.rs).screenshot:region_markup/shot region markupthat auto-opens the editor in pen mode and threaded theMarkupToolthroughlaunch_editorandopen_screenshot_editor(src/plugins/screenshot.rs,src/gui/mod.rs).render_markup_layers,Markup*types) and added unit tests exercising rendering and undo/redo behavior (tests/screenshot_plugin.rs).Testing
cargo fmtwhich completed successfully.cargo test --test screenshot_pluginto build and run the unit tests added intests/screenshot_plugin.rs(which includemarkup_layers_render_on_imageandmarkup_history_undo_redo), but the test run failed during build due to a missing system library when compiling a dependency:alsa-sysreported a missingalsa.pc(pkg-config / ALSA system library), causing the test invocation to abort; tests themselves were added and exercise pixel-level changes and history undo/redo semantics.Codex Task