Skip to content

Commit

Permalink
[elements] Fixes for 81d4887: BrushStyle fix isNull; DrawingStyle fin…
Browse files Browse the repository at this point in the history
…ish incomplete BrushStyle refactor.
  • Loading branch information
mpaperno committed Aug 16, 2023
1 parent a24f728 commit 88c5763
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/modules/elements/BrushStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class BrushStyle implements IRenderable {
/** true if color string is empty OR represents a transparent color. */
get isEmpty(): boolean { return this._empty; }
/** true if color string is empty. */
get isNull(): boolean { return this._color.length > 0; }
get isNull(): boolean { return !this._color.length; }

set color(v: string) {
if (!v) {
Expand Down
6 changes: 2 additions & 4 deletions src/modules/elements/DrawingStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,10 @@ export default class DrawingStyle implements IRenderable
//console.log(state.pos, dataType);
switch (dataType) {
case 'fillColor':
if (data.value.startsWith('#'))
this.fill = new BrushStyle(data.value);
this.fill.color = data.value;
break;
case 'shadowColor':
if (data.value.startsWith('#'))
this.shadow.color = data.value;
this.shadow.color = data.value;
break;
case 'shadow': {
// shadow is specified as (blur [,offsetX[,offsetY]])
Expand Down

0 comments on commit 88c5763

Please sign in to comment.