Skip to content

Canvas: a two-finger twist rotates the selection - #674

Merged
h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
NikitkaRa:cursor/trackpad-twist-7e0f
Oct 14, 2026
Merged

h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
NikitkaRa:cursor/trackpad-twist-7e0f

Conversation

@NikitkaRa

Copy link
Copy Markdown
Contributor

Summary

  • macOS turns a two-finger trackpad twist into egui's Rotate event, which DeckCraft ignored. While the pointer is over the canvas, the twist now rotates the selected shapes.
  • The whole gesture is one undo step; ending it does not commit an in-progress drag.
  • No-op when nothing is selected, text is being edited, a dialog or slide show is up, or the pointer is off the canvas.
  • Pinch-zoom and two-finger scrolling unchanged.

Test plan

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace (except 3 known macOS env font/IME failures)
  • cargo xtask assets, layers, wasm
  • Twist 10° → 350° → 20° lands on 20°; one undo returns to 0°; in-progress drag not committed
  • Rotate events through the editor: off-canvas no-op; over canvas 20° + 10° = 30°, one undo
  • Physical trackpad twist (not driven)

macOS delivers a trackpad rotation as egui's Rotate event. While the
pointer is over the canvas, that twist turns the selected shapes, and
the whole gesture is one undo step. Pinch-zoom and scrolling are unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
@h-a-n-a-s-h-i
h-a-n-a-s-h-i merged commit 6f38c95 into storytold:main Oct 14, 2026
h-a-n-a-s-h-i pushed a commit that referenced this pull request Oct 14, 2026
… on land-r5 (#644 #652 #655 #702 #571 #539 #674 #648 #697 #479 #369 #368)

# Conflicts:
#	crates/ui-egui/src/canvas.rs
#	crates/ui-egui/src/ribbon.rs
@echelon

echelon commented Oct 14, 2026

Copy link
Copy Markdown
Member

Thank you for this contribution, @NikitkaRa! It has landed on main and will ship in the next DeckCraft release.

If you haven't already, please come join us on Discord: https://discord.gg/artcraft

anishguduru pushed a commit to anishguduru/deckcraft that referenced this pull request Oct 16, 2026
…it#4587) (storytold#674)

eframe creates PdfCraft's window hidden, restores the saved state
(app.ron, persist_window) and shows the window after the first frame is
drawn. For a window closed maximized, winit 0.30.13 applies the maximized
state with ShowWindow(SW_MAXIMIZE), which shows a hidden window: PdfCraft
appeared unpainted (white), was hidden again, then shown with SW_SHOW and
SW_MAXIMIZE once more. rust-windowing/winit#4586 also shows the window's
focus state going wrong on this path.

vendor/winit now skips the maximize while the window is hidden and shows a
hidden window that is maximized with one SW_MAXIMIZE, as
rust-windowing/winit#4587 (approved upstream) does on winit master. That is
the later, focus-safe form of #4575; #4575's other change (re-sending
SW_MINIMIZE on every flag change while minimized) is not taken. Transitions
between two visible states make the same ShowWindow calls as before. A test
fails if a re-vendored winit loses the patch.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Brandon Thomas <echelon@gmail.com>
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.

3 participants