mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Updated tests for new bound vs bounds function.
This commit is contained in:
parent
dc01cf0dc9
commit
9a3c6926dc
@ -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);
|
||||||
|
};
|
||||||
|
@ -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)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user