@@ -187,8 +187,8 @@ export function makeScreenshotEditorComponent({ imageBuffer, dialog, options }:
187
187
const cutoutCanvas = DOCUMENT . createElement ( 'canvas' ) ;
188
188
const imageBox = constructRect ( getContainedSize ( imageBuffer ) ) ;
189
189
const croppingBox = constructRect ( croppingRect ) ;
190
- cutoutCanvas . width = croppingBox . width ;
191
- cutoutCanvas . height = croppingBox . height ;
190
+ cutoutCanvas . width = croppingBox . width * DPI ;
191
+ cutoutCanvas . height = croppingBox . height * DPI ;
192
192
193
193
const cutoutCtx = cutoutCanvas . getContext ( '2d' ) ;
194
194
if ( cutoutCtx && imageBuffer ) {
@@ -200,8 +200,8 @@ export function makeScreenshotEditorComponent({ imageBuffer, dialog, options }:
200
200
( croppingBox . height / imageBox . height ) * imageBuffer . height ,
201
201
0 ,
202
202
0 ,
203
- croppingBox . width ,
204
- croppingBox . height ,
203
+ cutoutCanvas . width ,
204
+ cutoutCanvas . height ,
205
205
) ;
206
206
}
207
207
@@ -210,8 +210,8 @@ export function makeScreenshotEditorComponent({ imageBuffer, dialog, options }:
210
210
ctx . clearRect ( 0 , 0 , imageBuffer . width , imageBuffer . height ) ;
211
211
imageBuffer . width = cutoutCanvas . width ;
212
212
imageBuffer . height = cutoutCanvas . height ;
213
- imageBuffer . style . width = `${ cutoutCanvas . width } px` ;
214
- imageBuffer . style . height = `${ cutoutCanvas . height } px` ;
213
+ imageBuffer . style . width = `${ croppingBox . width } px` ;
214
+ imageBuffer . style . height = `${ croppingBox . height } px` ;
215
215
ctx . drawImage ( cutoutCanvas , 0 , 0 ) ;
216
216
resizeCropper ( ) ;
217
217
}
0 commit comments