dcf2ad9820
Open this PR in different browsers, and you will see that the svg below will render differently in different browsers. The svg was exported from our staging. Seems like Chrome handles `clip-path` when set via the style differently than Safari and Firefox. I've reworked the logic so that it now uses a `clip-path` definition and applies that to the image. ![shape_xPSLLIG9yQkqAACrv1OxE](https://github.com/tldraw/tldraw/assets/2523721/4d0baba3-f5bf-4e78-96fe-aaa91ead107f) Also fixes a bunch of issues when copy pasting via the menu. It seems like we can't store the write function to a variable: ![image](https://github.com/tldraw/tldraw/assets/2523721/8d38edaf-8d63-462b-9f1a-c38960add7d7) Fixes https://github.com/tldraw/tldraw/issues/2254 ### Before ![CleanShot 2023-11-30 at 09 30 24](https://github.com/tldraw/tldraw/assets/2523721/93c06d5f-bfb2-4d97-8819-a8560c770304) ### After ![CleanShot 2023-11-30 at 09 30 55](https://github.com/tldraw/tldraw/assets/2523721/29e0f699-d0e8-4fb2-b90e-1d14ee609e52) ### 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 an image, apply crop to it (best if you crop from all sides, just to make sure) 2. Copy as png and make sure the image is correctly cropped in the created image. ### Release Notes - Fix exporting of cropped images. |
||
---|---|---|
.. | ||
assets | ||
editor | ||
state | ||
store | ||
tldraw | ||
tlschema | ||
utils | ||
validate |