Skip to content

Commit 96a79b8

Browse files
mtizianoZack Story
authored andcommitted
fix drawer side "right" margin progressively increase (#352)
* fix drawer side "right" margin progressively increase * fix drawer side "right" margin progressively increase iPhone X
1 parent 5afddb3 commit 96a79b8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ export default class Drawer extends Component {
280280
let length = this._prevLength + delta
281281
length = Math.min(length, this.getOpenLength())
282282
length = Math.max(length, this.getClosedLength())
283+
length = Math.round(length*2)/2
283284
this._length = length
284285

285286
this.updatePosition()
@@ -397,7 +398,7 @@ export default class Drawer extends Component {
397398
duration: this.props.tweenDuration,
398399
easingType: this.props.tweenEasing,
399400
onFrame: (tweenValue) => {
400-
this._length = tweenValue
401+
this._length = Math.round(tweenValue*2)/2;
401402
this.updatePosition()
402403
},
403404
onEnd: () => {
@@ -431,7 +432,7 @@ export default class Drawer extends Component {
431432
easingType: this.props.tweenEasing,
432433
duration: this.props.tweenDuration,
433434
onFrame: (tweenValue) => {
434-
this._length = tweenValue
435+
this._length = Math.round(tweenValue*2)/2;
435436
this.updatePosition()
436437
},
437438
onEnd: () => {

0 commit comments

Comments
 (0)