carbon-app / carbon

:black_heart: Create and share beautiful images of your source code
https://carbon.now.sh
MIT License
34.29k stars 1.9k forks source link

Fix WidthHandler not following mouse position #1488

Open awsr opened 10 months ago

awsr commented 10 months ago

This fixes the editor edge not lining up with the mouse when adjusting the width.

Due to the editor being centered, the adjustments have to be done in increments of 2px. While 1px adjustments can be done in the settings dropdown, I have also included a fallback for the old behavior by holding Shift while dragging. Since this is non-obvious, I have included a brief tooltip when hovering over the width handle.

vercel[bot] commented 10 months ago

@awsr is attempting to deploy a commit to the Carbon Team on Vercel.

A member of the Team first needs to authorize it.