From bcc32f19c53f9c0e422b195db83a3cf87bbd5b37 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Sat, 26 Sep 2020 00:25:06 -0700 Subject: Show active values correctly for x\y option sensitivity --- grapher/Models/Options/ActiveValueLabelXY.cs | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'grapher/Models/Options/ActiveValueLabelXY.cs') diff --git a/grapher/Models/Options/ActiveValueLabelXY.cs b/grapher/Models/Options/ActiveValueLabelXY.cs index 9498c66..1367a6a 100644 --- a/grapher/Models/Options/ActiveValueLabelXY.cs +++ b/grapher/Models/Options/ActiveValueLabelXY.cs @@ -1,4 +1,6 @@ -namespace grapher.Models.Options +using System.Drawing; + +namespace grapher.Models.Options { public class ActiveValueLabelXY { @@ -20,6 +22,14 @@ Y.Width = ShortenedWidth; Y.FormatString = Constants.ShortenedFormatString; + X.ValueLabel.Margin = new System.Windows.Forms.Padding(0); + Y.ValueLabel.Margin = new System.Windows.Forms.Padding(0); + X.ValueLabel.UseCompatibleTextRendering = true; + Y.ValueLabel.UseCompatibleTextRendering = true; + DefaultFont = X.ValueLabel.Font; + ShortenedFont = new Font(DefaultFont.FontFamily, (float)7.75); + Y.ValueLabel.Font = ShortenedFont; + Combined = false; SetCombined(); } @@ -32,6 +42,10 @@ public ActiveValueLabel Y { get; } + public Font DefaultFont { get; } + + public Font ShortenedFont { get; } + public bool Combined { get; private set; } public int Left @@ -90,6 +104,7 @@ X.FormatString = Constants.DefaultActiveValueFormatString; X.Width = FullWidth; X.Prefix = string.Empty; + X.ValueLabel.Font = DefaultFont; Y.Hide(); } @@ -103,6 +118,7 @@ X.FormatString = Constants.ShortenedFormatString; X.Width = ShortenedWidth; X.Prefix = "X"; + X.ValueLabel.Font = ShortenedFont; Y.Prefix = "Y"; Y.Show(); } @@ -127,7 +143,7 @@ private void Align (int width) { FullWidth = width; - ShortenedWidth = (FullWidth - Constants.ActiveLabelXYSeparation) / 2; + ShortenedWidth = FullWidth / 2; SetYLeft(); Y.Width = ShortenedWidth; -- cgit v1.2.3