提交 6b370697 编写于 作者: K Kener

dataZoom's start & end should not be round #1150

上级 4afec3ab
......@@ -606,26 +606,22 @@ define(function (require) {
this._startShape.style.x = this._fillerShae.style.x - this._handleSize;
this._endShape.style.x = this._fillerShae.style.x + this._fillerShae.style.width;
this._zoom.start = Math.floor(
(this._startShape.style.x - this._location.x)
/ this._location.width * 100
);
this._zoom.end = Math.ceil(
(this._endShape.style.x + this._handleSize - this._location.x)
/ this._location.width * 100
);
this._zoom.start = (
this._startShape.style.x - this._location.x
) / this._location.width * 100;
this._zoom.end = (
this._endShape.style.x + this._handleSize - this._location.x
) / this._location.width * 100;
}
else {
this._startShape.style.y = this._fillerShae.style.y - this._handleSize;
this._endShape.style.y = this._fillerShae.style.y + this._fillerShae.style.height;
this._zoom.start = Math.floor(
(this._startShape.style.y - this._location.y)
/ this._location.height * 100
);
this._zoom.end = Math.ceil(
(this._endShape.style.y + this._handleSize - this._location.y)
/ this._location.height * 100
);
this._zoom.start = (
this._startShape.style.y - this._location.y
) / this._location.height * 100;
this._zoom.end = (
this._endShape.style.y + this._handleSize - this._location.y
) / this._location.height * 100;
}
this.zr.modShape(this._startShape.id);
this.zr.modShape(this._endShape.id);
......@@ -644,28 +640,24 @@ define(function (require) {
b = this._endShape.style.x;
this._fillerShae.style.x = Math.min(a, b) + this._handleSize;
this._fillerShae.style.width = Math.abs(a - b) - this._handleSize;
this._zoom.start = Math.floor(
(Math.min(a, b) - this._location.x)
/ this._location.width * 100
);
this._zoom.end = Math.ceil(
(Math.max(a, b) + this._handleSize - this._location.x)
/ this._location.width * 100
);
this._zoom.start = (
Math.min(a, b) - this._location.x
) / this._location.width * 100;
this._zoom.end = (
Math.max(a, b) + this._handleSize - this._location.x
) / this._location.width * 100;
}
else {
a = this._startShape.style.y;
b = this._endShape.style.y;
this._fillerShae.style.y = Math.min(a, b) + this._handleSize;
this._fillerShae.style.height = Math.abs(a - b) - this._handleSize;
this._zoom.start = Math.floor(
(Math.min(a, b) - this._location.y)
/ this._location.height * 100
);
this._zoom.end = Math.ceil(
(Math.max(a, b) + this._handleSize - this._location.y)
/ this._location.height * 100
);
this._zoom.start = (
Math.min(a, b) - this._location.y
) / this._location.height * 100;
this._zoom.end = (
Math.max(a, b) + this._handleSize - this._location.y
) / this._location.height * 100;
}
this.zr.modShape(this._fillerShae.id);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册