mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
fix: context scale for high resolution displays with foreignobjectrendering (#1782)
This commit is contained in:
parent
49f87fb680
commit
7027900f49
@ -16,6 +16,7 @@ export default class ForeignObjectRenderer {
|
|||||||
this.canvas.height = Math.floor(options.height) * options.scale;
|
this.canvas.height = Math.floor(options.height) * options.scale;
|
||||||
this.canvas.style.width = `${options.width}px`;
|
this.canvas.style.width = `${options.width}px`;
|
||||||
this.canvas.style.height = `${options.height}px`;
|
this.canvas.style.height = `${options.height}px`;
|
||||||
|
this.ctx.scale(options.scale, options.scale);
|
||||||
|
|
||||||
options.logger.log(
|
options.logger.log(
|
||||||
`ForeignObject renderer initialized (${options.width}x${options.height} at ${options.x},${options.y}) with scale ${options.scale}`
|
`ForeignObject renderer initialized (${options.width}x${options.height} at ${options.x},${options.y}) with scale ${options.scale}`
|
||||||
|
Loading…
Reference in New Issue
Block a user