summaryrefslogtreecommitdiff
path: root/grapher/Models/Options/ActiveValueLabelXY.cs
diff options
context:
space:
mode:
Diffstat (limited to 'grapher/Models/Options/ActiveValueLabelXY.cs')
-rw-r--r--grapher/Models/Options/ActiveValueLabelXY.cs27
1 files changed, 25 insertions, 2 deletions
diff --git a/grapher/Models/Options/ActiveValueLabelXY.cs b/grapher/Models/Options/ActiveValueLabelXY.cs
index c8caddf..3f94847 100644
--- a/grapher/Models/Options/ActiveValueLabelXY.cs
+++ b/grapher/Models/Options/ActiveValueLabelXY.cs
@@ -43,9 +43,9 @@ namespace grapher.Models.Options
public bool Combined { get; private set; }
- private int FullWidth { get; }
+ private int FullWidth { get; set; }
- private int ShortenedWidth { get; }
+ private int ShortenedWidth { get; set; }
#endregion Properties
@@ -93,6 +93,29 @@ namespace grapher.Models.Options
Combined = false;
}
+ public void AlignActiveValues(int width)
+ {
+ Align(width);
+
+ if (Combined)
+ {
+ X.Width = FullWidth;
+ }
+ else
+ {
+ X.Width = ShortenedWidth;
+ }
+ }
+
+ private void Align (int width)
+ {
+ FullWidth = width;
+ ShortenedWidth = (FullWidth - Constants.ActiveLabelXYSeparation) / 2;
+
+ Y.Left = X.Left + ShortenedWidth + Constants.ActiveLabelXYSeparation;
+ Y.Width = ShortenedWidth;
+ }
+
#endregion Methods
}
}