From 00d5400e155e3854d09826ad8dba45d35a3dc968 Mon Sep 17 00:00:00 2001 From: Lu Wilson Date: Thu, 4 Apr 2024 10:41:45 +0100 Subject: [PATCH] Stickies: Use page space for sticky shadow rotation (#3352) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR makes sticky shadows use page space rotation, not shape space rotation. This brings it in line with what our other shapes do (eg: bookmarks) https://github.com/tldraw/tldraw/assets/15892272/6b0ae307-7811-4a11-a29d-2c61cafd3d1d ### Change Type - [ ] `sdk` — Changes the tldraw SDK - [ ] `dotcom` — Changes the tldraw.com web app - [ ] `docs` — Changes to the documentation, examples, or templates. - [ ] `vs code` — Changes to the vscode plugin - [ ] `internal` — Does not affect user-facing stuff - [ ] `bugfix` — Bug fix - [ ] `feature` — New feature - [ ] `improvement` — Improving existing features - [ ] `chore` — Updating dependencies, other boring stuff - [ ] `galaxy brain` — Architectural changes - [ ] `tests` — Changes to any test code - [ ] `tools` — Changes to infrastructure, CI, internal scripts, debugging tools, etc. - [ ] `dunno` — I don't know ### 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 - Add a brief release note for your PR here. --- packages/tldraw/src/lib/shapes/note/NoteShapeUtil.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/tldraw/src/lib/shapes/note/NoteShapeUtil.tsx b/packages/tldraw/src/lib/shapes/note/NoteShapeUtil.tsx index 4e3c72518..4e6ade8b2 100644 --- a/packages/tldraw/src/lib/shapes/note/NoteShapeUtil.tsx +++ b/packages/tldraw/src/lib/shapes/note/NoteShapeUtil.tsx @@ -156,9 +156,11 @@ export class NoteShapeUtil extends ShapeUtil { const noteHeight = this.getHeight(shape) // eslint-disable-next-line react-hooks/rules-of-hooks - const rotation = useValue('shape rotation', () => this.editor.getShape(id)?.rotation ?? 0, [ - this.editor, - ]) + const rotation = useValue( + 'shape rotation', + () => this.editor.getShapePageTransform(id)?.rotation() ?? 0, + [this.editor] + ) // todo: consider hiding shadows on dark mode if they're invisible anyway // eslint-disable-next-line react-hooks/rules-of-hooks