Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Scale the drawing when saving history. (#4370)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenba committed May 24, 2018
1 parent 4f7b66c commit a50e819
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions server/src/pages/shot/editor-history.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,18 @@ class EditRecord {
copy.width = canvas.width;
copy.height = canvas.height;
const copyContext = copy.getContext("2d");
copyContext.drawImage(canvas, 0, 0);
copyContext.scale(devicePixelRatio, devicePixelRatio);
copyContext.drawImage(
canvas,
0, 0, canvas.width, canvas.height,
0, 0, area.width, area.height);
return copy;
}

copy.width = area.width;
copy.height = area.height;
copy.width = area.width * devicePixelRatio;
copy.height = area.height * devicePixelRatio;
const copyContext = copy.getContext("2d");
copyContext.scale(devicePixelRatio, devicePixelRatio);
copyContext.drawImage(
canvas,
area.left * devicePixelRatio,
Expand Down

0 comments on commit a50e819

Please sign in to comment.