Skip to content

fix: correct efficient zoom threshold for scaled shapes#8040

Merged
steveruizok merged 1 commit intomainfrom
ani/dynamic-resize-dash
Feb 24, 2026
Merged

fix: correct efficient zoom threshold for scaled shapes#8040
steveruizok merged 1 commit intomainfrom
ani/dynamic-resize-dash

Conversation

@AniKrisn
Copy link
Copy Markdown
Contributor

@AniKrisn AniKrisn commented Feb 19, 2026

In order to fix dynamic-size shapes losing their visual detail (shadows, dashes) too aggressively when zoomed out, this PR corrects the efficient zoom threshold formula for scaled shapes.

The threshold was using scale * 0.25, which made detail disappear sooner for larger-scale shapes — the opposite of what's correct. A note created at 5% zoom with scale 20 looks the same on screen as a scale-1 note at 100% zoom, so it should keep its shadow and dashes. Changed to 0.25 / scale so the threshold accounts for the shape's visual size.

Closes #7999

Change type

  • bugfix

Test plan

  1. Enable dynamic size mode
  2. Create a sticky note while zoomed out (e.g. 5-10%) — verify it keeps its shadow, not a grey line
  3. Create a dashed arrow while zoomed out — verify it stays dashed, not solid
  4. Create a dashed geo shape while zoomed out — verify it stays dashed
  5. Verify normal (scale: 1) shapes still behave the same at all zoom levels

Release notes

  • Fix dynamic-size shapes losing shadows and dashes too early when zoomed out

The zoom threshold for hiding shadows (notes) and forcing solid
rendering (arrows, geo shapes) was using `scale * 0.25`, which made
the threshold higher for larger-scale shapes. This is backwards —
a dynamic-sized note with scale 20 at 5% zoom looks the same as a
scale-1 note at 100%, so it should keep its shadow/dashes. Changed
to `0.25 / scale` so the threshold accounts for visual size.

Closes #7999

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@vercel
Copy link
Copy Markdown

vercel bot commented Feb 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
examples Ready Ready Preview Feb 19, 2026 5:03pm
5 Skipped Deployments
Project Deployment Actions Updated (UTC)
analytics Ignored Ignored Feb 19, 2026 5:03pm
chat-template Ignored Ignored Feb 19, 2026 5:03pm
tldraw-docs Ignored Ignored Feb 19, 2026 5:03pm
tldraw-shader Ignored Ignored Feb 19, 2026 5:03pm
workflow-template Ignored Ignored Feb 19, 2026 5:03pm

Request Review

@huppy-bot huppy-bot bot added the bugfix Bug fix label Feb 24, 2026
@steveruizok steveruizok added this pull request to the merge queue Feb 24, 2026
Merged via the queue into main with commit 8d5feda Feb 24, 2026
24 of 25 checks passed
@steveruizok steveruizok deleted the ani/dynamic-resize-dash branch February 24, 2026 15:36
@steveruizok steveruizok restored the ani/dynamic-resize-dash branch February 24, 2026 17:40
steveruizok added a commit that referenced this pull request Feb 27, 2026
Add 12 new entries from PRs merged since v4.4.0:
- Featured: click-through on transparent image pixels (#7942)
- API: enum-to-const-object refactor (#8084)
- Improvements: SVG sanitizer (#7896), save-on-blur (#8037)
- Bug fixes: cross-origin download (#8090), zero-size draw (#8067),
  rich text toolbar cleanup (#8050), zoom threshold (#8040),
  selection foreground fallback (#8011), sticky note SVG shadow (#7934),
  arrow frame clamping (#7932), zero pressure draw (#5693)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sticky note shadow renders as thick grey line when zoomed out with dynamic size

2 participants