Skip to content

Commit 878d375

Browse files
committed
make sure that out-of-geo scrolling does not emit relayout evt
1 parent b66d9c0 commit 878d375

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/plots/geo/zoom.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ function zoomNonClipped(geo, projection) {
109109
var INSIDETOLORANCEPXS = 2;
110110

111111
var mouse0, rotate0, translate0, lastRotate, zoomPoint,
112-
mouse1, rotate1, point1;
112+
mouse1, rotate1, point1, didZoom;
113113

114114
function position(x) { return projection.invert(x); }
115115

@@ -157,12 +157,13 @@ function zoomNonClipped(geo, projection) {
157157
lastRotate = rotate1;
158158
}
159159

160+
didZoom = true;
160161
geo.render();
161162
}
162163

163164
function handleZoomend() {
164165
d3.select(this).style(zoomendStyle);
165-
sync(geo, projection, syncCb);
166+
if(didZoom) sync(geo, projection, syncCb);
166167
}
167168

168169
function syncCb(set) {

test/jasmine/tests/geo_test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1955,6 +1955,8 @@ describe('Test geo zoom/pan/drag interactions:', function() {
19551955
.then(function() { return scroll([131, 159], [-200, 200]); })
19561956
.then(function() {
19571957
// scrolling outside subplot frame should log errors,
1958+
// nor emit events
1959+
expect(eventData).toBeUndefined();
19581960
})
19591961
.catch(failTest)
19601962
.then(done);

0 commit comments

Comments
 (0)