diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c73a60..b899d4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ Additions Improvements - Cache TokenizedString inner offsets for non-Left text alignments to improve performance - Exposed the epsilon value used by Element calculations +- Made Image ScaleToImage take ui scale into account Fixes - Fixed VerticalSpace height parameter being an integer diff --git a/MLEM.Ui/Elements/Image.cs b/MLEM.Ui/Elements/Image.cs index 364a284..3bf6cd5 100644 --- a/MLEM.Ui/Elements/Image.cs +++ b/MLEM.Ui/Elements/Image.cs @@ -43,6 +43,7 @@ namespace MLEM.Ui.Elements { private bool scaleToImage; /// /// Whether this image element's should be based on the size of the given. + /// Note that, when scaling to the image's size, the is also taken into account. /// public bool ScaleToImage { get => this.scaleToImage; @@ -97,7 +98,7 @@ namespace MLEM.Ui.Elements { /// protected override Vector2 CalcActualSize(RectangleF parentArea) { - return this.Texture != null && this.scaleToImage ? this.Texture.Size.ToVector2() : base.CalcActualSize(parentArea); + return this.Texture != null && this.scaleToImage ? this.Texture.Size.ToVector2() * this.Scale : base.CalcActualSize(parentArea); } ///