@@ -96,7 +96,7 @@ function Cropper(options) {
96
96
const parentBounds = this . canvas . parentElement . getBoundingClientRect ( ) ;
97
97
if ( top ) {
98
98
const ySpan = this . selector . offsetTop + this . selector . offsetHeight ;
99
- let top = event . pageY - parentBounds . top ;
99
+ let top = Math . round ( event . pageY ) - parentBounds . top ;
100
100
if ( top < 0 ) {
101
101
top = 0 ;
102
102
}
@@ -108,7 +108,7 @@ function Cropper(options) {
108
108
}
109
109
if ( left ) {
110
110
const xSpan = this . selector . offsetLeft + this . selector . offsetWidth ;
111
- let left = event . pageX - parentBounds . left ;
111
+ let left = Math . round ( event . pageX ) - parentBounds . left ;
112
112
if ( left < 0 ) {
113
113
left = 0 ;
114
114
}
@@ -120,7 +120,7 @@ function Cropper(options) {
120
120
}
121
121
if ( bottom ) {
122
122
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 ;
124
124
if ( height < 0 ) {
125
125
height = 0 ;
126
126
}
@@ -130,7 +130,7 @@ function Cropper(options) {
130
130
}
131
131
if ( right ) {
132
132
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 ;
134
134
if ( width < 0 ) {
135
135
width = 0 ;
136
136
}
@@ -366,7 +366,7 @@ function Cropper(options) {
366
366
this . mirror . width = width ;
367
367
this . mirror . height = height ;
368
368
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' ) ;
370
370
}
371
371
372
372
/**
@@ -388,7 +388,7 @@ function Cropper(options) {
388
388
this . mirrorContext . rotate ( 90 * rotation * Math . PI / 180 ) ;
389
389
this . mirrorContext . translate ( - this . image . width / 2 , - this . image . height / 2 ) ;
390
390
this . mirrorContext . drawImage ( this . image , 0 , 0 ) ;
391
- this . mirror . toBlob ( handleBlob ( callback ) , 'image/png' , 1 ) ;
391
+ this . mirror . toBlob ( handleBlob ( callback ) , 'image/png' ) ;
392
392
}
393
393
394
394
/**
0 commit comments