From a6448c4a2447a090558da5f52dea3dc418389e8a Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 8 Sep 2020 12:35:23 -0700 Subject: Fix few small bugs --- grapher/Models/Options/ActiveValueLabel.cs | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'grapher/Models/Options/ActiveValueLabel.cs') diff --git a/grapher/Models/Options/ActiveValueLabel.cs b/grapher/Models/Options/ActiveValueLabel.cs index df7ac42..18a4400 100644 --- a/grapher/Models/Options/ActiveValueLabel.cs +++ b/grapher/Models/Options/ActiveValueLabel.cs @@ -22,11 +22,12 @@ namespace grapher.Models.Options public ActiveValueLabel(Label valueLabel, Label centeringLabel) { ValueLabel = valueLabel; - ValueLabel.ForeColor = Constants.ActiveValueFontColor; - Left = centeringLabel.Left; - Width = centeringLabel.Width; ValueLabel.AutoSize = false; ValueLabel.TextAlign = ContentAlignment.MiddleCenter; + ValueLabel.ForeColor = Constants.ActiveValueFontColor; + + CenteringLabel = centeringLabel; + Align(); FormatString = Constants.DefaultActiveValueFormatString; Prefix = string.Empty; @@ -98,6 +99,21 @@ namespace grapher.Models.Options } } + public int Height + { + get + { + return ValueLabel.Height; + } + + set + { + ValueLabel.Height = value; + } + } + + public Label CenteringLabel { get; } + #endregion Properties #region Methods @@ -127,6 +143,12 @@ namespace grapher.Models.Options ValueLabel.Text = string.IsNullOrWhiteSpace(Prefix) ? Value: $"{Prefix}: {Value}"; } + public void Align() + { + Left = CenteringLabel.Left; + Width = CenteringLabel.Width; + } + #endregion Methods } } -- cgit v1.2.3