Skip to content

Commit

Permalink
fix: path object not checking theme props (google#6451)
Browse files Browse the repository at this point in the history
* fix: path object not checking theme props

* fix: error msgs
  • Loading branch information
BeksOmega authored Sep 26, 2022
1 parent abad51f commit 893787b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions core/renderers/geras/path_object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ 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 tertiary colour of ' +
'the block style');
}
this.svgPathLight.setAttribute('stroke', this.style.colourTertiary);
this.svgPathDark.setAttribute('fill', this.colourDark);

Expand Down Expand Up @@ -118,6 +123,11 @@ 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 secondary colour ' +
'of the block style block style');
}
this.svgPathDark.setAttribute('fill', this.style.colourSecondary);
this.svgPath.setAttribute('stroke', 'none');
this.svgPath.setAttribute('fill', this.style.colourSecondary);
Expand Down

0 comments on commit 893787b

Please sign in to comment.