Skip to content

Hand and Zoom cursors drawn like the tool cursors (Windows showed the move arrows, no magnifier) - #1238

Merged
bflatastic merged 2 commits into
storytold:mainfrom
zakariayacine:fix-view-cursors
Oct 11, 2026
Merged

bflatastic merged 2 commits into
storytold:mainfrom
zakariayacine:fix-view-cursors

Conversation

@zakariayacine

Copy link
Copy Markdown
Contributor

What and why

On Windows the Hand tool, Space and the Zoom tool showed the wrong cursors: winit maps egui's Grab and
Grabbing to the four-headed move cursor (IDC_SIZEALL, winit/src/platform_impl/windows/util.rs) and has
nothing for ZoomIn/ZoomOut, so holding Space showed arrows instead of a hand, and the Zoom tool (Z) showed no
magnifier. Those four were the only tool cursors left to the system (cursors.rs drew every other tool).

They are now vector glyphs like the others, in the same visual grammar (black on a white halo, Illustrator's
grammar): an open hand with the thumb to the left (Hand tool, Space), the same hand closed while the view is
dragged, and a magnifier with a plus in the lens or a minus with Alt. Shown as OS cursors on the desktop (#444) and
painted on the web as the other glyphs are. The canvas routes the Space, Hand and Zoom states through the same path
as the tool cursors instead of asking egui for system cursors.

How it was tested

  • cursors::tests: the four glyphs rasterize at every scale with the other 34, inside the 50 px limit, with an
    opaque body and the hotspot inside the bitmap; only the busy state (NotAllowed) stays a system cursor.
  • canvas::tests pass unchanged (54 tests in cursors:: and canvas::).
  • Seen on Windows 11 in a release build: Space shows the hand, dragging the closed hand, Z the magnifier, Alt the
    minus.
  • cargo xtask ci: all 7 steps passed (fmt, clippy, test, assets, brands, layers, wasm).

Developed with AI assistance (Claude Code); reviewed and tested locally on Windows 11.

Checklist

  • cargo xtask ci passes.
  • No panics in shipped code.
  • Clean-room: original glyphs drawn in code; nothing copied from Adobe products or GPL/AGPL code.
  • No new assets (the glyphs are code, like the other cursors).

🤖 Generated with Claude Code

zakariayacine and others added 2 commits October 12, 2026 01:15
On Windows the Hand tool, Space and the Zoom tool showed the wrong
cursors: winit maps egui's Grab and Grabbing to the four-headed move
cursor (IDC_SIZEALL) and has nothing for ZoomIn/ZoomOut, so the hand
appeared as arrows and the magnifier not at all. Those four were the
only tool cursors left to the system.

They are now vector glyphs like the others (an open and a closed hand,
a magnifier with a plus or a minus), shown as OS cursors on the desktop
and painted on the web, and the canvas routes the Space, Hand and Zoom
states through the same path as the tool cursors.

Tests: the glyphs rasterize at every scale with the others; only the
busy states stay system cursors.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@bflatastic
bflatastic merged commit 5b9af81 into storytold:main Oct 11, 2026
1 check passed
@bflatastic

Copy link
Copy Markdown
Member

Thanks @zakariayacine, merged! Windows finally gets a real hand and magnifier.

I added one commit on top. When I rendered the glyphs, the fingers' halos covered each other's outlines, and the plus in the magnifier had a gap where its bars crossed. Now every halo is drawn before any outline, and the plus and minus are drawn without halos, since the lens is already white. Rebased onto main, and the full local gate passed.

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.

2 participants