mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-26 06:28:35 +01:00
made the scroll bar be grabbed in the center
This commit is contained in:
parent
cbb265a5d5
commit
053f865a00
1 changed files with 4 additions and 4 deletions
|
@ -56,11 +56,11 @@ namespace MLEM.Ui.Elements {
|
||||||
|
|
||||||
if (this.isMouseHeld) {
|
if (this.isMouseHeld) {
|
||||||
if (this.Horizontal) {
|
if (this.Horizontal) {
|
||||||
var internalX = this.MousePos.X - this.Area.X;
|
var internalX = this.MousePos.X - this.Area.X - this.ScrollerSize.X * this.Scale / 2;
|
||||||
this.CurrentValue = internalX / (float) this.Area.Width * this.MaxValue;
|
this.CurrentValue = internalX / (this.Area.Width - this.ScrollerSize.X * this.Scale) * this.MaxValue;
|
||||||
} else {
|
} else {
|
||||||
var internalY = this.MousePos.Y - this.Area.Y;
|
var internalY = this.MousePos.Y - this.Area.Y - this.ScrollerSize.Y * this.Scale / 2;
|
||||||
this.CurrentValue = internalY / (float) this.Area.Height * this.MaxValue;
|
this.CurrentValue = internalY / (this.Area.Height - this.ScrollerSize.Y * this.Scale) * this.MaxValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue