From caaedc559f1475bcd325832023e55ac20b70aa7a Mon Sep 17 00:00:00 2001 From: Lu Wilson Date: Mon, 26 Jun 2023 13:57:15 +0100 Subject: [PATCH] Fix text shapes not having colour (#1649) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR fixes text shapes always being black. It also fixes Note shapes not having the correct text colour. Screenshot 2023-06-26 at 11 26 45 ### Change Type - [x] `patch` — Bug fix [^1]: publishes a `patch` release, for devDependencies use `internal` [^2]: will not publish a new version ### Test Plan 1. Make a text shape. 2. Make sure you can change its colour. 3. Make a note shape. 4. Make sure its text label stays black when you change the note's colour. - [ ] Unit Tests - [ ] End to end tests ### Release Notes - None: Fixes an unreleased bug. --- packages/editor/src/lib/editor/shapes/text/TextShapeUtil.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/editor/src/lib/editor/shapes/text/TextShapeUtil.tsx b/packages/editor/src/lib/editor/shapes/text/TextShapeUtil.tsx index 5b270b1e5..f6b28d8d6 100644 --- a/packages/editor/src/lib/editor/shapes/text/TextShapeUtil.tsx +++ b/packages/editor/src/lib/editor/shapes/text/TextShapeUtil.tsx @@ -63,9 +63,10 @@ export class TextShapeUtil extends ShapeUtil { const { id, type, - props: { text }, + props: { text, color }, } = shape + const theme = getDefaultColorTheme(this.editor) const { width, height } = this.getMinDimensions(shape) const { @@ -95,6 +96,7 @@ export class TextShapeUtil extends ShapeUtil { transformOrigin: 'top left', width: Math.max(1, width), height: Math.max(FONT_SIZES[shape.props.size] * TEXT_PROPS.lineHeight, height), + color: theme[color].solid, }} >