Skip to content

Commit

Permalink
more changes
Browse files Browse the repository at this point in the history
  • Loading branch information
asturur committed Dec 29, 2022
2 parents 6d02015 + 6b10575 commit 75d35ac
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/canvas/static_canvas.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1308,13 +1308,11 @@ export class StaticCanvas<
* @return {String}
*/
createSVGRefElementsMarkup(): string {
return ['background', 'overlay']
return (['background', 'overlay'] as const)
.map((prop) => {
const fill = this[`${prop}Color` as 'overlayColor' | `backgroundColor`];
const fill = this[`${prop}Color`];
if (isFiller(fill)) {
const shouldTransform = this[
`${prop}Vpt` as 'overlayVpt' | `backgroundVpt`
] as boolean,
const shouldTransform = this[`${prop}Vpt`],
vpt = this.viewportTransform,
object = {
width: this.width / (shouldTransform ? vpt[0] : 1),
Expand Down

0 comments on commit 75d35ac

Please sign in to comment.