Skip to content

Commit 34a0cf7

Browse files
committed
🌴 clearAndResetSelect calls
1 parent f682fb8 commit 34a0cf7

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

src/plots/cartesian/dragbox.js

+17-19
Original file line numberDiff line numberDiff line change
@@ -178,23 +178,23 @@ function makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) {
178178
prepSelect(e, startX, startY, dragOptions, dragModeNow);
179179
} else {
180180
dragOptions.clickFn = clickFn;
181-
182-
if(allFixedRanges) {
183-
clearAndResetSelect();
184-
} else if(dragModeNow === 'zoom') {
185-
dragOptions.moveFn = zoomMove;
186-
dragOptions.doneFn = zoomDone;
187-
188-
// zoomMove takes care of the threshold, but we need to
189-
// minimize this so that constrained zoom boxes will flip
190-
// orientation at the right place
191-
dragOptions.minDrag = 1;
192-
193-
zoomPrep(e, startX, startY);
194-
} else if(dragModeNow === 'pan') {
195-
dragOptions.moveFn = plotDrag;
196-
dragOptions.doneFn = dragTail;
197-
clearAndResetSelect();
181+
clearAndResetSelect();
182+
183+
if(!allFixedRanges) {
184+
if(dragModeNow === 'zoom') {
185+
dragOptions.moveFn = zoomMove;
186+
dragOptions.doneFn = zoomDone;
187+
188+
// zoomMove takes care of the threshold, but we need to
189+
// minimize this so that constrained zoom boxes will flip
190+
// orientation at the right place
191+
dragOptions.minDrag = 1;
192+
193+
zoomPrep(e, startX, startY);
194+
} else if(dragModeNow === 'pan') {
195+
dragOptions.moveFn = plotDrag;
196+
dragOptions.doneFn = dragTail;
197+
}
198198
}
199199
}
200200
};
@@ -285,8 +285,6 @@ function makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) {
285285
zb = makeZoombox(zoomlayer, lum, xs, ys, path0);
286286

287287
corners = makeCorners(zoomlayer, xs, ys);
288-
289-
clearAndResetSelect();
290288
}
291289

292290
function zoomMove(dx0, dy0) {

0 commit comments

Comments
 (0)