We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ec70d23 commit 54fbe73Copy full SHA for 54fbe73
1 file changed
js/text.js
@@ -1,4 +1,3 @@
1
-// import html2canvas from 'html2canvas/dist/html2canvas.min';
2
import { KEYS } from './utils';
3
import { tr } from './translation';
4
import domtoimage from 'dom-to-image';
@@ -205,7 +204,14 @@ export default class TextTool {
205
204
const origBorder = this.input.style.border;
206
const scale = this.main.getScale();
207
this.input.style.border = 'none';
208
- domtoimage.toPng(this.input)
+ domtoimage.toPng(this.input, {
+ style: {
209
+ 'transform-origin': 'top left',
210
+ transform: `scale(${scale})`
211
+ },
212
+ width: this.input.clientWidth * scale,
213
+ height: this.input.clientHeight * scale,
214
+ })
215
.then((dataUrl) => {
216
const img = new Image();
217
img.src = dataUrl;
0 commit comments