Skip to content

Commit

Permalink
fix(text): shadowGenerator should work with undefined shadow (#4028)
Browse files Browse the repository at this point in the history
Fixes #4024
  • Loading branch information
sogehige committed Aug 12, 2020
1 parent 1df3c3b commit 3d6ce84
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/panel/helpers/text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ export function shadowGenerator(shadow: {
blur: number;
opacity: number;
color: string;
}[]) {
}[] | undefined) {
const output = [];
for (const s of shadow) {
output.push(`${s.shiftRight}px ${s.shiftDown}px ${s.blur}px ${Color(s.color).alpha(s.opacity / 100)}`);
if (shadow) {
for (const s of shadow) {
output.push(`${s.shiftRight}px ${s.shiftDown}px ${s.blur}px ${Color(s.color).alpha(s.opacity / 100)}`);
}
}
return output.join(', ');
}

0 comments on commit 3d6ce84

Please sign in to comment.