Skip to content

Commit

Permalink
Updated tests for new bound vs bounds function.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chad Petersen committed Sep 6, 2022
1 parent dc01cf0 commit 9a3c692
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 4 additions & 0 deletions src/css/layout/__mocks__/bounds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ export const {Bounds} = jest.requireActual('../bounds');
export const parseBounds = (): typeof Bounds[] => {
return [new Bounds(0, 0, 200, 50)];
};

export const parseBound = (): typeof Bounds => {
return new Bounds(0, 0, 200, 50);
};
12 changes: 7 additions & 5 deletions src/render/canvas/canvas-renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -617,11 +617,13 @@ export class CanvasRenderer extends Renderer {
]);
areas.forEach((area) => {
const [path, x, y, width, height] = area;
const pattern = this.ctx.createPattern(
this.resizeImage(image!, width, height),
'repeat'
) as CanvasPattern;
this.renderRepeat(path, pattern, x, y);
if (image) {
const pattern = this.ctx.createPattern(
this.resizeImage(image, width, height),
'repeat'
) as CanvasPattern;
this.renderRepeat(path, pattern, x, y);
}
});
}
} else if (isLinearGradient(backgroundImage)) {
Expand Down

0 comments on commit 9a3c692

Please sign in to comment.