File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 172
172
var height = img . naturalHeight || img . height
173
173
var destWidth = width
174
174
var destHeight = height
175
+ var cropped = false
175
176
var maxWidth
176
177
var maxHeight
177
178
var minWidth
276
277
loadImage . renderImageToCanvas (
277
278
canvas ,
278
279
img ,
279
- sourceX ,
280
- sourceY ,
280
+ cropped ? 0 : sourceX ,
281
+ cropped ? 0 : sourceY ,
281
282
sourceWidth ,
282
283
sourceHeight ,
283
284
0 ,
284
285
0 ,
285
286
canvas . width ,
286
287
canvas . height
287
288
)
289
+ cropped = true
288
290
sourceWidth = canvas . width
289
291
sourceHeight = canvas . height
290
292
img = document . createElement ( 'canvas' )
313
315
return loadImage . renderImageToCanvas (
314
316
canvas ,
315
317
img ,
316
- sourceX ,
317
- sourceY ,
318
+ cropped ? 0 : sourceX ,
319
+ cropped ? 0 : sourceY ,
318
320
sourceWidth ,
319
321
sourceHeight ,
320
322
0 ,
You can’t perform that action at this time.
0 commit comments