File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 255255 options
256256 )
257257 }
258- canvas = document . createElement ( 'canvas' )
259258 downsamplingRatio = options . downsamplingRatio
260259 if (
261260 downsamplingRatio > 0 &&
264263 destHeight < sourceHeight
265264 ) {
266265 while ( sourceWidth * downsamplingRatio > destWidth ) {
266+ canvas = document . createElement ( 'canvas' )
267267 canvas . width = sourceWidth * downsamplingRatio
268268 canvas . height = sourceHeight * downsamplingRatio
269269 loadImage . drawImage (
282282 sourceWidth = canvas . width
283283 sourceHeight = canvas . height
284284 // eslint-disable-next-line no-param-reassign
285- img = document . createElement ( 'canvas' )
286- img . width = sourceWidth
287- img . height = sourceHeight
288- loadImage . drawImage (
289- canvas ,
290- img ,
291- 0 ,
292- 0 ,
293- sourceWidth ,
294- sourceHeight ,
295- sourceWidth ,
296- sourceHeight ,
297- options
298- )
285+ img = canvas
299286 }
300287 }
288+ canvas = document . createElement ( 'canvas' )
301289 canvas . width = destWidth
302290 canvas . height = destHeight
303291 loadImage . transformCoordinates ( canvas , options , data )
You can’t perform that action at this time.
0 commit comments