mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Apply border radius correctly on image elements
This commit is contained in:
parent
fe97851988
commit
ad1119a76c
@ -88,7 +88,9 @@ export default class CanvasRenderer {
|
|||||||
);
|
);
|
||||||
const width = typeof image.width === 'number' ? image.width : contentBox.width;
|
const width = typeof image.width === 'number' ? image.width : contentBox.width;
|
||||||
const height = typeof image.height === 'number' ? image.height : contentBox.height;
|
const height = typeof image.height === 'number' ? image.height : contentBox.height;
|
||||||
|
this.ctx.save();
|
||||||
|
this.path(calculatePaddingBoxPath(container.curvedBounds));
|
||||||
|
this.ctx.clip();
|
||||||
this.ctx.drawImage(
|
this.ctx.drawImage(
|
||||||
image,
|
image,
|
||||||
0,
|
0,
|
||||||
@ -100,6 +102,7 @@ export default class CanvasRenderer {
|
|||||||
contentBox.width,
|
contentBox.width,
|
||||||
contentBox.height
|
contentBox.height
|
||||||
);
|
);
|
||||||
|
this.ctx.restore();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user