summaryrefslogtreecommitdiff
path: root/grapher/Form1.cs
diff options
context:
space:
mode:
authorJacobPalecki <[email protected]>2021-01-21 20:46:50 -0800
committerGitHub <[email protected]>2021-01-21 20:46:50 -0800
commitaaac0e43f690191488cc4d1d40971e56350aee55 (patch)
treecbfa5d075e32ea004460ec223c1d5f3d089b3dbc /grapher/Form1.cs
parentMerge pull request #65 from JacobPalecki/Directional (diff)
parentchange toggle text, "enabled" -> "disable" (diff)
downloadrawaccel-1.4.0.tar.xz
rawaccel-1.4.0.zip
Merge pull request #66 from a1xd/1.4-tweaksv1.4.0
add angle snapping, update signed/
Diffstat (limited to 'grapher/Form1.cs')
-rw-r--r--grapher/Form1.cs17
1 files changed, 13 insertions, 4 deletions
diff --git a/grapher/Form1.cs b/grapher/Form1.cs
index 71a5e01..6927211 100644
--- a/grapher/Form1.cs
+++ b/grapher/Form1.cs
@@ -160,6 +160,8 @@ namespace grapher
DirectionalityRangeLabel,
RangeActiveValueX,
RangeActiveValueY);
+
+ ResizeAndCenter();
}
#endregion Constructor
@@ -191,18 +193,25 @@ namespace grapher
chartsPanel.AutoScrollPosition = Constants.Origin;
}
- public void DoResize()
+ public void ResizeAndCenter()
{
ResetAutoScroll();
- var workingArea = Screen.PrimaryScreen.WorkingArea;
+ var workingArea = Screen.FromControl(this).WorkingArea;
var chartsPreferredSize = chartsPanel.GetPreferredSize(Constants.MaxSize);
Size = new Size
{
- Width = Math.Min(workingArea.Width - Location.X, optionsPanel.Size.Width + chartsPreferredSize.Width),
- Height = Math.Min(workingArea.Height - Location.Y, chartsPreferredSize.Height + 48)
+ Width = Math.Min(workingArea.Width, optionsPanel.Size.Width + chartsPreferredSize.Width),
+ Height = Math.Min(workingArea.Height, chartsPreferredSize.Height + 48)
};
+
+ Location = new Point
+ {
+ X = workingArea.X + (workingArea.Width - Size.Width) / 2,
+ Y = workingArea.Y + (workingArea.Height - Size.Height) / 2
+ };
+
}
#endregion Method