File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 7575 }
7676
7777 // Canvas render method, allows to implement a different rendering algorithm:
78- loadImage . renderImageToCanvas = function (
79- canvas ,
78+ loadImage . drawImage = function (
8079 img ,
80+ canvas ,
8181 sourceX ,
8282 sourceY ,
8383 sourceWidth ,
240240 while ( sourceWidth * downsamplingRatio > destWidth ) {
241241 canvas . width = sourceWidth * downsamplingRatio
242242 canvas . height = sourceHeight * downsamplingRatio
243- loadImage . renderImageToCanvas (
244- canvas ,
243+ loadImage . drawImage (
245244 img ,
245+ canvas ,
246246 sourceX ,
247247 sourceY ,
248248 sourceWidth ,
259259 img = document . createElement ( 'canvas' )
260260 img . width = sourceWidth
261261 img . height = sourceHeight
262- loadImage . renderImageToCanvas (
263- img ,
262+ loadImage . drawImage (
264263 canvas ,
264+ img ,
265265 0 ,
266266 0 ,
267267 sourceWidth ,
279279 canvas . style . width = canvas . width / pixelRatio + 'px'
280280 canvas . style . height = canvas . height / pixelRatio + 'px'
281281 }
282- return loadImage . renderImageToCanvas (
283- canvas ,
282+ return loadImage . drawImage (
284283 img ,
284+ canvas ,
285285 sourceX ,
286286 sourceY ,
287287 sourceWidth ,
You can’t perform that action at this time.
0 commit comments