Updated tests for new bound vs bounds function.

This commit is contained in:
Chad Petersen 2022-09-06 15:56:20 -06:00
parent dc01cf0dc9
commit 9a3c6926dc
2 changed files with 11 additions and 5 deletions

View File

@ -2,3 +2,7 @@ export const {Bounds} = jest.requireActual('../bounds');
export const parseBounds = (): typeof Bounds[] => { export const parseBounds = (): typeof Bounds[] => {
return [new Bounds(0, 0, 200, 50)]; return [new Bounds(0, 0, 200, 50)];
}; };
export const parseBound = (): typeof Bounds => {
return new Bounds(0, 0, 200, 50);
};

View File

@ -617,11 +617,13 @@ export class CanvasRenderer extends Renderer {
]); ]);
areas.forEach((area) => { areas.forEach((area) => {
const [path, x, y, width, height] = area; const [path, x, y, width, height] = area;
const pattern = this.ctx.createPattern( if (image) {
this.resizeImage(image!, width, height), const pattern = this.ctx.createPattern(
'repeat' this.resizeImage(image, width, height),
) as CanvasPattern; 'repeat'
this.renderRepeat(path, pattern, x, y); ) as CanvasPattern;
this.renderRepeat(path, pattern, x, y);
}
}); });
} }
} else if (isLinearGradient(backgroundImage)) { } else if (isLinearGradient(backgroundImage)) {