kopia lustrzana https://github.com/backface/turtlestitch
Merge pull request #549 from Gubolin/issue_285
allow negative min/max values for sliders (fix #285)pull/3/merge
commit
03390418ae
|
@ -5916,14 +5916,14 @@ SliderMorph.prototype.setStart = function (num) {
|
|||
var newStart;
|
||||
if (typeof num === 'number') {
|
||||
this.start = Math.min(
|
||||
Math.max(num, 0),
|
||||
num,
|
||||
this.stop - this.size
|
||||
);
|
||||
} else {
|
||||
newStart = parseFloat(num);
|
||||
if (!isNaN(newStart)) {
|
||||
this.start = Math.min(
|
||||
Math.max(newStart, 0),
|
||||
newStart,
|
||||
this.stop - this.size
|
||||
);
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue