Browse Source

fix(disableDefaultBahavior): fix disableDefaultBehavior for scroll

pull/2447/head
Yoshiya Hinosawa 6 years ago
parent
commit
8b409031c1
  1. 10
      src/zoom.js

10
src/zoom.js

@ -23,9 +23,7 @@ ChartInternal.prototype.initZoom = function () {
var e = d3.event.sourceEvent;
if (e && e.type === "brush") { return; }
if (!config.zoom_disableDefaultBehavior) {
$$.redrawForZoom.call($$);
}
$$.redrawForZoom();
config.zoom_onzoom.call($$.api, $$.x.orgDomain());
})
@ -136,9 +134,14 @@ ChartInternal.prototype.redrawForZoom = function () {
zoom.update();
if (config.zoom_disableDefaultBehavior) {
return;
}
if ($$.isCategorized() && x.orgDomain()[0] === $$.orgXDomain[0]) {
x.domain([$$.orgXDomain[0] - 1e-10, x.orgDomain()[1]]);
}
$$.redraw({
withTransition: false,
withY: config.zoom_rescale,
@ -146,6 +149,7 @@ ChartInternal.prototype.redrawForZoom = function () {
withEventRect: false,
withDimension: false
});
if (d3.event.sourceEvent && d3.event.sourceEvent.type === 'mousemove') {
$$.cancelClick = true;
}

Loading…
Cancel
Save