Skip to content

Conversation

@BlueGreenMagick
Copy link
Contributor

Fixes #8234

The problematic code was introduced in #3512 to fix 'shuffle' bug. (d9af609)

At the time, the code was fine. The commit also had corresponding code in generateElementCanvas() that generated canvas drawing with floored x and y as base. Which was why x1 = Math.floor(x1) needed to be used in drawElementFromCanvas(), when copying over the rendered element from that canvas.

But in #4357, the Math.floor code in generatedElementCanvas() was removed, yet it did not remove the matching code from drawElementFromCanvas() as well. Which resulted in the freehand drawing being rendered to a slightly wrong position.

@vercel
Copy link

vercel bot commented Jul 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
excalidraw ✅ Ready (Inspect) Visit Preview Jul 14, 2024 6:38am
excalidraw-package-example ✅ Ready (Inspect) Visit Preview Jul 14, 2024 6:38am
excalidraw-package-example-with-nextjs ✅ Ready (Inspect) Visit Preview Jul 14, 2024 6:38am
1 Skipped Deployment
Name Status Preview Updated (UTC)
docs ⬜️ Ignored (Inspect) Visit Preview Jul 14, 2024 6:38am

@dwelle
Copy link
Member

dwelle commented Jul 14, 2024

Awesome, good catch! ❤️

@dwelle dwelle enabled auto-merge (squash) July 14, 2024 08:44
@dwelle dwelle merged commit df8875a into excalidraw:master Jul 14, 2024
@BlueGreenMagick BlueGreenMagick deleted the fix-freedraw-jitter branch July 14, 2024 11:04
@BlueGreenMagick
Copy link
Contributor Author

BlueGreenMagick commented Jul 16, 2024

Sorry, why is the test failing in master branch, when it passed here and in my local setup?

Jauhen pushed a commit to Jauhen/excalidraw that referenced this pull request Nov 7, 2024
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.

Freedraw jittering bug

2 participants