summaryrefslogtreecommitdiff
path: root/grapher/Models/Options/ActiveValueLabelXY.cs
diff options
context:
space:
mode:
authorJacob Palecki <[email protected]>2020-09-08 00:51:05 -0700
committerJacob Palecki <[email protected]>2020-09-08 00:51:05 -0700
commitf2322540dd904474587ddebfa8d96dc66a902530 (patch)
treecb1b8c5f4324acbb3586dfcac442d950c1f0a886 /grapher/Models/Options/ActiveValueLabelXY.cs
parentAdd chart resize (diff)
downloadrawaccel-f2322540dd904474587ddebfa8d96dc66a902530.tar.xz
rawaccel-f2322540dd904474587ddebfa8d96dc66a902530.zip
Alignment for whole mode works
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
}
}