1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-07-31 18:50:14 +02:00

Fixed screenshots for Retina display system

This commit is contained in:
AshBardhan
2017-10-15 11:59:41 +05:30
parent 98a6abd36e
commit 5b6fa361d5

View File

@@ -1567,12 +1567,14 @@ globalConsoleContainerEl
c.width = iframeBounds.width; c.width = iframeBounds.width;
c.height = iframeBounds.height; c.height = iframeBounds.height;
var ctx = c.getContext('2d'); var ctx = c.getContext('2d');
var devicePixelRatio = window.devicePixelRatio || 1;
ctx.drawImage( ctx.drawImage(
image, image,
iframeBounds.left, iframeBounds.left * devicePixelRatio,
iframeBounds.top, iframeBounds.top * devicePixelRatio,
iframeBounds.width, iframeBounds.width * devicePixelRatio,
iframeBounds.height, iframeBounds.height * devicePixelRatio,
0, 0,
0, 0,
iframeBounds.width, iframeBounds.width,