@@ -96,7 +96,7 @@ function Cropper(options) {
9696 const parentBounds = this . canvas . parentElement . getBoundingClientRect ( ) ;
9797 if ( top ) {
9898 const ySpan = this . selector . offsetTop + this . selector . offsetHeight ;
99- let top = event . pageY - parentBounds . top ;
99+ let top = Math . round ( event . pageY ) - parentBounds . top ;
100100 if ( top < 0 ) {
101101 top = 0 ;
102102 }
@@ -108,7 +108,7 @@ function Cropper(options) {
108108 }
109109 if ( left ) {
110110 const xSpan = this . selector . offsetLeft + this . selector . offsetWidth ;
111- let left = event . pageX - parentBounds . left ;
111+ let left = Math . round ( event . pageX ) - parentBounds . left ;
112112 if ( left < 0 ) {
113113 left = 0 ;
114114 }
@@ -120,7 +120,7 @@ function Cropper(options) {
120120 }
121121 if ( bottom ) {
122122 const maxHeight = this . canvas . offsetHeight - this . selector . offsetTop ;
123- height = event . pageY - parentBounds . top - this . selector . offsetTop ;
123+ height = Math . round ( event . pageY ) - parentBounds . top - this . selector . offsetTop ;
124124 if ( height < 0 ) {
125125 height = 0 ;
126126 }
@@ -130,7 +130,7 @@ function Cropper(options) {
130130 }
131131 if ( right ) {
132132 const maxWidth = this . canvas . offsetWidth - this . selector . offsetLeft ;
133- width = event . pageX - parentBounds . left - this . selector . offsetLeft ;
133+ width = Math . round ( event . pageX ) - parentBounds . left - this . selector . offsetLeft ;
134134 if ( width < 0 ) {
135135 width = 0 ;
136136 }
@@ -366,7 +366,7 @@ function Cropper(options) {
366366 this . mirror . width = width ;
367367 this . mirror . height = height ;
368368 this . mirrorContext . drawImage ( this . image , selectedX , selectedY , selectedWidth , selectedHeight , 0 , 0 , width , height ) ;
369- this . mirror . toBlob ( handleBlob ( callback ) , 'image/png' , 1 ) ;
369+ this . mirror . toBlob ( handleBlob ( callback ) , 'image/png' ) ;
370370 }
371371
372372 /**
@@ -388,7 +388,7 @@ function Cropper(options) {
388388 this . mirrorContext . rotate ( 90 * rotation * Math . PI / 180 ) ;
389389 this . mirrorContext . translate ( - this . image . width / 2 , - this . image . height / 2 ) ;
390390 this . mirrorContext . drawImage ( this . image , 0 , 0 ) ;
391- this . mirror . toBlob ( handleBlob ( callback ) , 'image/png' , 1 ) ;
391+ this . mirror . toBlob ( handleBlob ( callback ) , 'image/png' ) ;
392392 }
393393
394394 /**
0 commit comments