diff options
| author | Jacob Palecki <[email protected]> | 2020-09-08 01:09:19 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2020-09-08 01:09:19 -0700 |
| commit | 254a66eda9d9f6add21937b3570d29f64af4ab1e (patch) | |
| tree | 5d5a7995ae14d9aba924024a1694c5d1760634c6 /grapher/Models/Options/ActiveValueLabelXY.cs | |
| parent | Alignment for whole mode works (diff) | |
| download | rawaccel-254a66eda9d9f6add21937b3570d29f64af4ab1e.tar.xz rawaccel-254a66eda9d9f6add21937b3570d29f64af4ab1e.zip | |
Fix few small bugs
Diffstat (limited to 'grapher/Models/Options/ActiveValueLabelXY.cs')
| -rw-r--r-- | grapher/Models/Options/ActiveValueLabelXY.cs | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/grapher/Models/Options/ActiveValueLabelXY.cs b/grapher/Models/Options/ActiveValueLabelXY.cs index 3f94847..e6e4f52 100644 --- a/grapher/Models/Options/ActiveValueLabelXY.cs +++ b/grapher/Models/Options/ActiveValueLabelXY.cs @@ -22,10 +22,7 @@ namespace grapher.Models.Options X = x; Y = y; - FullWidth = x.Width; - ShortenedWidth = (FullWidth - Constants.ActiveLabelXYSeparation) / 2; - - Y.Left = X.Left + ShortenedWidth + Constants.ActiveLabelXYSeparation; + Align(x.Width); Y.Width = ShortenedWidth; Y.FormatString = Constants.ShortenedFormatString; @@ -43,6 +40,19 @@ namespace grapher.Models.Options public bool Combined { get; private set; } + public int Left + { + get + { + return X.Left; + } + set + { + X.Left = value; + SetYLeft(); + } + } + private int FullWidth { get; set; } private int ShortenedWidth { get; set; } @@ -112,10 +122,15 @@ namespace grapher.Models.Options FullWidth = width; ShortenedWidth = (FullWidth - Constants.ActiveLabelXYSeparation) / 2; - Y.Left = X.Left + ShortenedWidth + Constants.ActiveLabelXYSeparation; + SetYLeft(); Y.Width = ShortenedWidth; } + private void SetYLeft() + { + Y.Left = X.Left + ShortenedWidth + Constants.ActiveLabelXYSeparation; + } + #endregion Methods } } |