kopia lustrzana https://github.com/backface/turtlestitch
Merge pull request #2591 from jguille2/FixingSliders
Fixing slider position for lower valuespull/95/head
commit
2d4c38172e
|
@ -6933,18 +6933,24 @@ SliderMorph.prototype.fixLayout = function () {
|
||||||
bh = Math.max(bw, Math.round(this.height() * this.ratio()));
|
bh = Math.max(bw, Math.round(this.height() * this.ratio()));
|
||||||
this.button.setExtent(new Point(bw, bh));
|
this.button.setExtent(new Point(bw, bh));
|
||||||
posX = 1;
|
posX = 1;
|
||||||
posY = Math.min(
|
posY = Math.max(
|
||||||
Math.round((this.value - this.start) * this.unitSize()),
|
Math.min(
|
||||||
this.height() - this.button.height()
|
Math.round((this.value - this.start) * this.unitSize()),
|
||||||
|
this.height() - this.button.height()
|
||||||
|
),
|
||||||
|
0
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
bh = this.height() - 2;
|
bh = this.height() - 2;
|
||||||
bw = Math.max(bh, Math.round(this.width() * this.ratio()));
|
bw = Math.max(bh, Math.round(this.width() * this.ratio()));
|
||||||
this.button.setExtent(new Point(bw, bh));
|
this.button.setExtent(new Point(bw, bh));
|
||||||
posY = 1;
|
posY = 1;
|
||||||
posX = Math.min(
|
posX = Math.max(
|
||||||
Math.round((this.value - this.start) * this.unitSize()),
|
Math.min(
|
||||||
this.width() - this.button.width()
|
Math.round((this.value - this.start) * this.unitSize()),
|
||||||
|
this.width() - this.button.width()
|
||||||
|
),
|
||||||
|
0
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
this.button.setPosition(
|
this.button.setPosition(
|
||||||
|
|
Ładowanie…
Reference in New Issue