Skip to content

Commit

Permalink
fix: fix the problem of zero judgment.
Browse files Browse the repository at this point in the history
  • Loading branch information
simaQ committed Jul 31, 2018
1 parent cedf9d3 commit 2ecbade
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/interaction/pan.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,11 @@ class Pan extends Interaction {
let newMin = flag === 'x' ? min - panValue : min + panValue;

const limitRange = this.limitRange;
if (limitRange[field] && limitRange[field].min && newMin <= limitRange[field].min) {
if (limitRange[field] && !Util.isNil(limitRange[field].min) && newMin <= limitRange[field].min) {
newMin = limitRange[field].min;
newMax = (max - min) + newMin;
}
if (limitRange[field] && limitRange[field].max && newMax >= limitRange[field].max) {
if (limitRange[field] && !Util.isNil(limitRange[field].max) && newMax >= limitRange[field].max) {
newMax = limitRange[field].max;
newMin = newMax - (max - min);
}
Expand Down

0 comments on commit 2ecbade

Please sign in to comment.