diff --git a/MLEM.Ui/Elements/Element.cs b/MLEM.Ui/Elements/Element.cs index 1a7c885..c575829 100644 --- a/MLEM.Ui/Elements/Element.cs +++ b/MLEM.Ui/Elements/Element.cs @@ -326,8 +326,8 @@ namespace MLEM.Ui.Elements { protected virtual Point CalcActualSize(Rectangle parentArea) { return new Point( - (this.size.X > 1 ? this.ScaledSize.X : parentArea.Width * this.size.X).Floor(), - (this.size.Y > 1 ? this.ScaledSize.Y : parentArea.Height * this.size.Y).Floor()); + (this.size.X > 1 ? this.ScaledSize.X : parentArea.Width * this.size.X).Ceil(), + (this.size.Y > 1 ? this.ScaledSize.Y : parentArea.Height * this.size.Y).Ceil()); } protected virtual Rectangle GetAreaForAutoAnchors() { diff --git a/MLEM.Ui/Elements/ScrollBar.cs b/MLEM.Ui/Elements/ScrollBar.cs index f4f4ed1..012fa16 100644 --- a/MLEM.Ui/Elements/ScrollBar.cs +++ b/MLEM.Ui/Elements/ScrollBar.cs @@ -125,7 +125,7 @@ namespace MLEM.Ui.Elements { var scrollerOffset = new Point( !this.Horizontal ? 0 : (this.currValue / this.maxValue * (this.DisplayArea.Width - this.ScrollerSize.X * this.Scale)).Floor(), this.Horizontal ? 0 : (this.currValue / this.maxValue * (this.DisplayArea.Height - this.ScrollerSize.Y * this.Scale)).Floor()); - var scrollerRect = new Rectangle(scrollerPos + scrollerOffset, this.ScrollerSize.Multiply(this.Scale)); + var scrollerRect = new Rectangle(scrollerPos + scrollerOffset, new Point((this.ScrollerSize.X * this.Scale).Ceil(), (this.ScrollerSize.Y * this.Scale).Ceil())); batch.Draw(this.ScrollerTexture, scrollerRect, Color.White * alpha, this.Scale); base.Draw(time, batch, alpha); }