Skip to content

Commit

Permalink
fix(style): fixing style bug (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbanksdesign authored Feb 9, 2019
1 parent f42d24e commit 01b4f8d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion models/Fill/Fill.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Fill {
noiseIntensity: args.noiseIntensity || 0,
patternFillType: args.patternFillType || 0,
patternTileScale: args.patternTileScale || 1,
gradient: args.gradient ? new Gradient(args.gradient) : null,
gradient: args.gradient ? new Gradient(args.gradient) : undefined,
});
}
return this;
Expand Down
7 changes: 7 additions & 0 deletions models/Fill/Fill.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,11 @@ describe('Fill', () => {
it('should work from raw JSON', () => {
expect(true).toBeTruthy();
});

it('should work from user generated', () => {
const fill = new Fill({
color: '#fff',
});
expect(true).toBeTruthy();
});
});
2 changes: 1 addition & 1 deletion models/Rectangle/Rectangle.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class Rectangle extends Layer {
width: args.width,
height: args.height,
}),
style: Style.LayerStyle(args.style),
style: new Style(args.style),
name: args.name || id,
});
}
Expand Down
2 changes: 1 addition & 1 deletion models/Style/Style.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class Style {
borders: (args.borders || []).map(border => new Border(border)),
fills: (args.fills || []).map(fill => new Fill(fill)),
shadows: (args.shadows || []).map(shadow => new Shadow(shadow)),
textStyle: new TextStyle(args.textStyle),
textStyle: args.textStyle ? new TextStyle(args.textStyle) : undefined,
});
}
}
Expand Down

0 comments on commit 01b4f8d

Please sign in to comment.