Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: fix toHeight to return 1.5 when value is Infinity #64

Merged
merged 1 commit into from
Jun 6, 2018
Merged

FIX: fix toHeight to return 1.5 when value is Infinity #64

merged 1 commit into from
Jun 6, 2018

Conversation

liuzhishan
Copy link

根据range.js里180行:
if (this._maxValue > this._minValue) this._ratio = (bottom - top) / (this._maxValue - this._minValue);
如果_maxValue为极大,_minValue为极小,则_ratio应该为0。
因此在toHeight函数中如果value为Infinity,则直接返回1.5,否则返回正常情况下的
Math.floor(value * this._ratio + 1.5);

@chxj1992 chxj1992 merged commit 73afcca into chxj1992:master Jun 6, 2018
@chxj1992
Copy link
Owner

chxj1992 commented Jun 6, 2018

非常感谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants