提交 01d8ed56 编写于 作者: L lang

Ticks rounding error

上级 0f17e9c6
......@@ -7,6 +7,8 @@
define(function (require) {
var numberUtil = require('../util/number');
var mathFloor = Math.floor;
var mathCeil = Math.ceil;
/**
......@@ -147,7 +149,8 @@ define(function (require) {
var tick = niceExtent[0];
while (tick <= niceExtent[1]) {
ticks.push(tick);
tick += interval;
// Avoid rounding error
tick = numberUtil.round(tick + interval);
}
if (extent[1] > niceExtent[1]) {
ticks.push(extent[1]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册