From 2ecbade65a578918ae75b2e2cd3146a624735f94 Mon Sep 17 00:00:00 2001 From: simaQ Date: Tue, 31 Jul 2018 19:00:35 +0800 Subject: [PATCH] fix: fix the problem of zero judgment. --- src/interaction/pan.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/interaction/pan.js b/src/interaction/pan.js index b35defe84..8623e0634 100644 --- a/src/interaction/pan.js +++ b/src/interaction/pan.js @@ -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); }