mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-22 20:58:34 +01:00
fixed scroll bars still ceiling their values
This commit is contained in:
parent
da04514d05
commit
7f81f6469f
2 changed files with 2 additions and 2 deletions
|
@ -76,7 +76,7 @@ namespace MLEM.Ui.Elements {
|
|||
var lowestChild = this.GetLowestChild(e => !e.IsHidden);
|
||||
// the max value of the scrollbar is the amount of non-scaled pixels taken up by overflowing components
|
||||
var childrenHeight = lowestChild.Area.Bottom - firstChild.Area.Top;
|
||||
this.ScrollBar.MaxValue = ((childrenHeight - this.Area.Height) / this.Scale + this.ChildPadding.Y * 2).Ceil();
|
||||
this.ScrollBar.MaxValue = (childrenHeight - this.Area.Height) / this.Scale + this.ChildPadding.Y * 2;
|
||||
|
||||
// update the render target
|
||||
var targetArea = this.GetRenderTargetArea();
|
||||
|
|
|
@ -126,7 +126,7 @@ namespace MLEM.Ui.Elements {
|
|||
var scrollerOffset = new Vector2(
|
||||
!this.Horizontal ? 0 : this.currValue / this.maxValue * (this.DisplayArea.Width - this.ScrollerSize.X * this.Scale),
|
||||
this.Horizontal ? 0 : this.currValue / this.maxValue * (this.DisplayArea.Height - this.ScrollerSize.Y * this.Scale));
|
||||
var scrollerRect = new RectangleF(scrollerPos + scrollerOffset, new Vector2((this.ScrollerSize.X * this.Scale).Ceil(), (this.ScrollerSize.Y * this.Scale).Ceil()));
|
||||
var scrollerRect = new RectangleF(scrollerPos + scrollerOffset, this.ScrollerSize * this.Scale);
|
||||
batch.Draw(this.ScrollerTexture, scrollerRect, Color.White * alpha, this.Scale);
|
||||
base.Draw(time, batch, alpha, blendState, samplerState, matrix);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue