reduce gaps between marks

This commit is contained in:
just-boris
2015-11-23 00:17:29 +03:00
parent e8a86b91e2
commit f339db494b
+3 -3
View File
@@ -5,7 +5,7 @@ const Marks = ({className, marks, included, upperBound, lowerBound, max, min}) =
const marksKeys = Object.keys(marks);
const marksCount = marksKeys.length;
const unit = 100 / (marksCount - 1);
const markWidth = unit / 2 + '%';
const markWidth = unit * 0.9;
const range = max - min;
const elements = marksKeys.map(parseFloat).map((point) => {
@@ -16,8 +16,8 @@ const Marks = ({className, marks, included, upperBound, lowerBound, max, min}) =
[className + '-text-active']: isActived,
});
const style = { width: markWidth };
style.left = (point - min) / range * 100 - unit / 4 + '%';
const style = { width: markWidth + '%' };
style.left = (point - min) / range * 100 - markWidth / 2 + '%';
return (<span className={markClassName} style={style} key={point}>
{marks[point]}