From 4a9447b7bf53ab3a9645817aa6610b88fc3f4b16 Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Mon, 26 Sep 2022 20:13:18 +0000 Subject: [PATCH 1/2] fix: path object not checking theme props --- core/renderers/geras/path_object.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/renderers/geras/path_object.ts b/core/renderers/geras/path_object.ts index 7d24c1e218b..bae56a7ef29 100644 --- a/core/renderers/geras/path_object.ts +++ b/core/renderers/geras/path_object.ts @@ -90,6 +90,10 @@ export class PathObject extends BasePathObject { override applyColour(block: BlockSvg) { this.svgPathLight.style.display = ''; this.svgPathDark.style.display = ''; + if (!this.style.colourTertiary) { + throw new Error( + 'The renderer did not properly initialize the block style'); + } this.svgPathLight.setAttribute('stroke', this.style.colourTertiary); this.svgPathDark.setAttribute('fill', this.colourDark); @@ -118,6 +122,10 @@ export class PathObject extends BasePathObject { override updateShadow_(shadow: boolean) { if (shadow) { this.svgPathLight.style.display = 'none'; + if (!this.style.colourSecondary) { + throw new Error( + 'The renderer did not properly initialize the block style'); + } this.svgPathDark.setAttribute('fill', this.style.colourSecondary); this.svgPath.setAttribute('stroke', 'none'); this.svgPath.setAttribute('fill', this.style.colourSecondary); From 64f4013b2c0b5c9fc8283e855444d3a7e1ea42ad Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Mon, 26 Sep 2022 20:30:04 +0000 Subject: [PATCH 2/2] fix: error msgs --- core/renderers/geras/path_object.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/renderers/geras/path_object.ts b/core/renderers/geras/path_object.ts index bae56a7ef29..07d2fcbc557 100644 --- a/core/renderers/geras/path_object.ts +++ b/core/renderers/geras/path_object.ts @@ -92,7 +92,8 @@ export class PathObject extends BasePathObject { this.svgPathDark.style.display = ''; if (!this.style.colourTertiary) { throw new Error( - 'The renderer did not properly initialize the block style'); + 'The renderer did not properly initialize the tertiary colour of ' + + 'the block style'); } this.svgPathLight.setAttribute('stroke', this.style.colourTertiary); this.svgPathDark.setAttribute('fill', this.colourDark); @@ -124,7 +125,8 @@ export class PathObject extends BasePathObject { this.svgPathLight.style.display = 'none'; if (!this.style.colourSecondary) { throw new Error( - 'The renderer did not properly initialize the block style'); + 'The renderer did not properly initialize the secondary colour ' + + 'of the block style block style'); } this.svgPathDark.setAttribute('fill', this.style.colourSecondary); this.svgPath.setAttribute('stroke', 'none');