@@ -260,14 +260,8 @@ export default {
260260 ctx2 .clearRect (0 , 0 , this .canvasWidth , this .canvasHeight ); 
261261
262262 //  取一个随机坐标,作为拼图块的位置 
263-  this .pinX  =  this .getRandom ( 
264-  this .puzzleBaseSize , 
265-  this .canvasWidth  -  this .puzzleBaseSize  -  20  
266-  ); //  留20的边距 
267-  this .pinY  =  this .getRandom ( 
268-  20 , 
269-  this .canvasHeight  -  this .puzzleBaseSize  -  20  
270-  ); //  主图高度 - 拼图块自身高度 - 20边距 
263+  this .pinX  =  this .getRandom (this .puzzleBaseSize ,this .canvasWidth  -  this .puzzleBaseSize  -  20 ); //  留20的边距 
264+  this .pinY  =  this .getRandom (20 ,this .canvasHeight  -  this .puzzleBaseSize  -  20 ); //  主图高度 - 拼图块自身高度 - 20边距 
271265 img .crossOrigin  =  " anonymous" //  匿名,想要获取跨域的图片 
272266 img .onload  =  () =>  { 
273267 const  [x , y , w , h ] =  this .makeImgSize (img); 
@@ -366,7 +360,6 @@ export default {
366360 //  画整体背景图 
367361 ctx .save (); 
368362 ctx .globalCompositeOperation  =  " destination-over"  
369-  //  ctx.drawImage(img, 0, 0, this.canvasWidth, this.canvasHeight); 
370363 ctx .drawImage (img, x, y, w, h); 
371364 ctx .restore (); 
372365
0 commit comments