Merge pull request #160 from paulkaplan/fix-slider-ranges

Make color sliders go from 0 to 100
This commit is contained in:
Paul Kaplan 2017-10-30 11:09:00 -04:00 committed by GitHub
commit 8fdab88996
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -32,7 +32,7 @@ class SliderComponent extends React.Component {
event.preventDefault();
const backgroundBBox = this.background.getBoundingClientRect();
const x = event.clientX - backgroundBBox.left;
this.props.onChange(Math.max(1, Math.min(99, 100 * x / backgroundBBox.width)));
this.props.onChange(Math.max(0, Math.min(100, 100 * x / backgroundBBox.width)));
}
setBackground (ref) {