Skip to content

Commit

Permalink
Merge pull request chxj1992#64 from liuzhishan/master
Browse files Browse the repository at this point in the history
FIX: fix toHeight to return 1.5 when value is Infinity
  • Loading branch information
chxj1992 committed Jun 6, 2018
2 parents 9c9a34e + 731064d commit 73afcca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 5 additions & 2 deletions dist/kline.js
Original file line number Diff line number Diff line change
Expand Up @@ -14925,7 +14925,10 @@ function (_NamedObject) {
}, {
key: "toHeight",
value: function toHeight(value) {
return Math.floor(value * this._ratio + 1.5);
if (value == Infinity || this._ratio == 0) {
return 1.5;
}
return Math.floor(value * this._ratio + 1.5);
}
}, {
key: "update",
Expand Down Expand Up @@ -41812,4 +41815,4 @@ registerStorage(__WEBPACK_IMPORTED_MODULE_0__firebase_app__["default"]);
/***/ })
/******/ ]);
});
//# sourceMappingURL=kline.js.map
//# sourceMappingURL=kline.js.map
5 changes: 4 additions & 1 deletion src/js/ranges.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ export class Range extends NamedObject {
}

toHeight(value) {
return Math.floor(value * this._ratio + 1.5);
if (value == Infinity || this._ratio == 0) {
return 1.5;
}
return Math.floor(value * this._ratio + 1.5);
}

update() {
Expand Down

0 comments on commit 73afcca

Please sign in to comment.