tldraw/packages
David Sheldrick 9d8a0b0a8d
clamp x-box and check-box lines to stay within box at small scales (#1860)
Closes [#2737](https://github.com/tldraw/brivate/issues/2737)

For the checkbox and x-box the inner lines are inset slightly from the
edges to account for the stroke width. Alas at tiny box sizes (the box
is creates as w:1,h:1 during a drag-to-create interaction) this was
ending up with the insets overflowing such that they left the box on the
other side, creating miscalculations during the initial resizing.

This PR clamps the positions of the x-box and checkbox inner lines so
they don't escape the bounds of the box.

### Change Type

- [x] `patch` — Bug fix
- [ ] `minor` — New feature
- [ ] `major` — Breaking change
- [ ] `dependencies` — Changes to package dependencies[^1]
- [ ] `documentation` — Changes to the documentation only[^2]
- [ ] `tests` — Changes to any test code only[^2]
- [ ] `internal` — Any other changes that don't affect the published
package[^2]
- [ ] I don't know

[^1]: publishes a `patch` release, for devDependencies use `internal`
[^2]: will not publish a new version

### Test Plan

1. Add a step-by-step description of how to test your PR here.
2.

- [ ] Unit Tests
- [ ] End to end tests

### Release Notes

- Fixes a regression introduced by the geometry refactor related to
x-box and checkbox resizing.
2023-09-08 11:37:50 +00:00
..
assets [feature] Add val town embed (#1777) 2023-07-31 15:44:33 +00:00
editor avoid pixel rounding / transformation miscalc for overlay items (#1858) 2023-09-08 10:47:14 +00:00
state [improvement] More selection logic (#1806) 2023-08-13 15:55:24 +00:00
store SideEffectManager (#1785) 2023-08-02 11:05:14 +00:00
tldraw clamp x-box and check-box lines to stay within box at small scales (#1860) 2023-09-08 11:37:50 +00:00
tlschema [fix] embeds switching / tldraw embed (#1792) 2023-08-03 14:55:46 +00:00
utils move some utils into tldraw/utils (#1750) 2023-07-19 10:50:40 +00:00
validate Add shapes to exports (#1776) 2023-07-28 16:08:59 +00:00