diff options
| author | Jacob Palecki <[email protected]> | 2020-08-20 14:22:14 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2020-08-20 14:22:14 -0700 |
| commit | 7dbeae9d4cf108e78072b356d832123f12e42a90 (patch) | |
| tree | 9711fddfb5241a3dc859cd421aa4937d38a8852f /grapher/Models/Options/ActiveValueLabelXY.cs | |
| parent | Display active values (diff) | |
| download | rawaccel-7dbeae9d4cf108e78072b356d832123f12e42a90.tar.xz rawaccel-7dbeae9d4cf108e78072b356d832123f12e42a90.zip | |
Add accel type to active values and tweak color
Diffstat (limited to 'grapher/Models/Options/ActiveValueLabelXY.cs')
| -rw-r--r-- | grapher/Models/Options/ActiveValueLabelXY.cs | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/grapher/Models/Options/ActiveValueLabelXY.cs b/grapher/Models/Options/ActiveValueLabelXY.cs index b3b580f..12506e9 100644 --- a/grapher/Models/Options/ActiveValueLabelXY.cs +++ b/grapher/Models/Options/ActiveValueLabelXY.cs @@ -8,7 +8,8 @@ namespace grapher.Models.Options { public class ActiveValueLabelXY { - public const int ActiveLabelXYSeparation = 4; + public const int ActiveLabelXYSeparation = 2; + public const string ShortenedFormatString = "0.###"; public ActiveValueLabelXY( ActiveValueLabel x, @@ -16,6 +17,14 @@ namespace grapher.Models.Options { X = x; Y = y; + + FullWidth = x.Width; + ShortenedWidth = (FullWidth - ActiveLabelXYSeparation) / 2; + + Y.Left = X.Left + ShortenedWidth + ActiveLabelXYSeparation; + Y.Width = ShortenedWidth; + Y.FormatString = ShortenedFormatString; + Combined = false; SetCombined(); } @@ -26,6 +35,10 @@ namespace grapher.Models.Options public bool Combined { get; private set; } + private int FullWidth { get; } + + private int ShortenedWidth { get; } + public void SetValues(double x, double y) { X.SetValue(x); @@ -45,6 +58,9 @@ namespace grapher.Models.Options { if (!Combined) { + X.FormatString = ActiveValueLabel.DefaultFormatString; + X.Width = FullWidth; + X.Prefix = string.Empty; Y.Hide(); } @@ -55,6 +71,10 @@ namespace grapher.Models.Options { if (Combined) { + X.FormatString = ShortenedFormatString; + X.Width = ShortenedWidth; + X.Prefix = "X"; + Y.Prefix = "Y"; Y.Show(); } |