fix: context scale for high resolution displays with foreignobjectrendering (#1782)

This commit is contained in:
Justin Meyer 2019-04-07 18:49:29 -05:00 committed by Niklas von Hertzen
parent 49f87fb680
commit 7027900f49

View File

@ -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}`