File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -878,21 +878,22 @@ p5.Image = class {
878
878
}
879
879
const currBlend = this . drawingContext . globalCompositeOperation ;
880
880
881
- let scaleFactor = 1 ;
881
+ let imgScaleFactor = this . _pixelDensity ;
882
+ let maskScaleFactor = 1 ;
882
883
if ( p5Image instanceof p5 . Renderer ) {
883
- scaleFactor = p5Image . _pInst . _pixelDensity ;
884
+ maskScaleFactor = p5Image . _pInst . _pixelDensity ;
884
885
}
885
886
886
887
const copyArgs = [
887
888
p5Image ,
888
889
0 ,
889
890
0 ,
890
- scaleFactor * p5Image . width ,
891
- scaleFactor * p5Image . height ,
891
+ maskScaleFactor * p5Image . width ,
892
+ maskScaleFactor * p5Image . height ,
892
893
0 ,
893
894
0 ,
894
- this . width ,
895
- this . height
895
+ imgScaleFactor * this . width ,
896
+ imgScaleFactor * this . height
896
897
] ;
897
898
898
899
this . drawingContext . globalCompositeOperation = 'destination-in' ;
@@ -907,8 +908,8 @@ p5.Image = class {
907
908
this . gifProperties . frames [ i ] . image = this . drawingContext . getImageData (
908
909
0 ,
909
910
0 ,
910
- this . width ,
911
- this . height
911
+ imgScaleFactor * this . width ,
912
+ imgScaleFactor * this . height
912
913
) ;
913
914
}
914
915
this . drawingContext . putImageData (
You can’t perform that action at this time.
0 commit comments