From 2a7dc119eb881632b76313445b57869f9f0d07d7 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 14 Nov 2021 21:04:50 +0100 Subject: [PATCH] Removed ScrollBar ScrollerOffset (which didn't actually work) --- CHANGELOG.md | 3 +++ MLEM.Ui/Elements/ScrollBar.cs | 7 +------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d391afe..b60865d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,9 @@ Fixes - Fixed text not being pasted into a text field at all if it contains characters that don't match the input rule - Fixed panels that don't auto-hide their scroll bars ignoring their width for child padding +Removals +- Removed ScrollBar ScrollerOffset (which didn't actually work) + ### MLEM.Data Additions - Allow RuntimeTexturePacker to automatically dispose submitted textures when packing diff --git a/MLEM.Ui/Elements/ScrollBar.cs b/MLEM.Ui/Elements/ScrollBar.cs index e8d988d..453361c 100644 --- a/MLEM.Ui/Elements/ScrollBar.cs +++ b/MLEM.Ui/Elements/ScrollBar.cs @@ -31,10 +31,6 @@ namespace MLEM.Ui.Elements { /// public StyleProp ScrollerTexture; /// - /// The 's offset from the calculated position of the scroller. Use this to pad the scroller. - /// - public Vector2 ScrollerOffset; - /// /// The scroller's width and height /// public Vector2 ScrollerSize; @@ -203,11 +199,10 @@ namespace MLEM.Ui.Elements { batch.Draw(this.Background, this.DisplayArea, Color.White * alpha, this.Scale); if (this.MaxValue > 0) { - var scrollerPos = new Vector2(this.DisplayArea.X + this.ScrollerOffset.X, this.DisplayArea.Y + this.ScrollerOffset.Y); var scrollerOffset = new Vector2( !this.Horizontal ? 0 : this.CurrentValue / this.maxValue * (this.DisplayArea.Width - this.ScrollerSize.X * this.Scale), this.Horizontal ? 0 : this.CurrentValue / this.maxValue * (this.DisplayArea.Height - this.ScrollerSize.Y * this.Scale)); - var scrollerRect = new RectangleF(scrollerPos + scrollerOffset, this.ScrollerSize * this.Scale); + var scrollerRect = new RectangleF(this.DisplayArea.Location + scrollerOffset, this.ScrollerSize * this.Scale); batch.Draw(this.ScrollerTexture, scrollerRect, Color.White * alpha, this.Scale); } base.Draw(time, batch, alpha, blendState, samplerState, matrix);