From c4114c73f86477bea05d12a0a818c8336e0a0527 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Tue, 17 Nov 2020 21:05:48 +0100 Subject: [PATCH] fixed tooltip distance from the mouse changing with scale --- MLEM.Ui/Elements/Tooltip.cs | 2 +- MLEM.Ui/Style/UntexturedStyle.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MLEM.Ui/Elements/Tooltip.cs b/MLEM.Ui/Elements/Tooltip.cs index 06279f8..928d4d7 100644 --- a/MLEM.Ui/Elements/Tooltip.cs +++ b/MLEM.Ui/Elements/Tooltip.cs @@ -79,7 +79,7 @@ namespace MLEM.Ui.Elements { /// public void SnapPositionToMouse() { var viewport = this.System.Viewport.Size; - var offset = this.Input.MousePosition.ToVector2() / this.Scale + this.MouseOffset; + var offset = (this.Input.MousePosition.ToVector2() + this.MouseOffset.Value) / this.Scale; if (offset.X < 0) offset.X = 0; if (offset.Y < 0) diff --git a/MLEM.Ui/Style/UntexturedStyle.cs b/MLEM.Ui/Style/UntexturedStyle.cs index 790a7a8..24c93d6 100644 --- a/MLEM.Ui/Style/UntexturedStyle.cs +++ b/MLEM.Ui/Style/UntexturedStyle.cs @@ -32,7 +32,7 @@ namespace MLEM.Ui.Style { this.RadioHoveredColor = Color.LightGray; this.RadioCheckmark = batch.GenerateTexture(Color.CornflowerBlue).Region; this.TooltipBackground = batch.GenerateTexture(Color.Black * 0.65F, Color.Black * 0.65F); - this.TooltipOffset = new Vector2(2, 3); + this.TooltipOffset = new Vector2(8, 16); this.ProgressBarTexture = batch.GenerateTexture(Color.RoyalBlue); this.ProgressBarColor = Color.White; this.ProgressBarProgressPadding = new Vector2(1);