@@ -187,8 +187,8 @@ export function makeScreenshotEditorComponent({ imageBuffer, dialog, options }:
187187 const cutoutCanvas = DOCUMENT . createElement ( 'canvas' ) ;
188188 const imageBox = constructRect ( getContainedSize ( imageBuffer ) ) ;
189189 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 ;
192192
193193 const cutoutCtx = cutoutCanvas . getContext ( '2d' ) ;
194194 if ( cutoutCtx && imageBuffer ) {
@@ -200,8 +200,8 @@ export function makeScreenshotEditorComponent({ imageBuffer, dialog, options }:
200200 ( croppingBox . height / imageBox . height ) * imageBuffer . height ,
201201 0 ,
202202 0 ,
203- croppingBox . width ,
204- croppingBox . height ,
203+ cutoutCanvas . width ,
204+ cutoutCanvas . height ,
205205 ) ;
206206 }
207207
@@ -210,8 +210,8 @@ export function makeScreenshotEditorComponent({ imageBuffer, dialog, options }:
210210 ctx . clearRect ( 0 , 0 , imageBuffer . width , imageBuffer . height ) ;
211211 imageBuffer . width = cutoutCanvas . width ;
212212 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` ;
215215 ctx . drawImage ( cutoutCanvas , 0 , 0 ) ;
216216 resizeCropper ( ) ;
217217 }
0 commit comments