diff options
| author | JacobPalecki <[email protected]> | 2021-01-21 20:46:50 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-01-21 20:46:50 -0800 |
| commit | aaac0e43f690191488cc4d1d40971e56350aee55 (patch) | |
| tree | cbfa5d075e32ea004460ec223c1d5f3d089b3dbc /grapher/Form1.cs | |
| parent | Merge pull request #65 from JacobPalecki/Directional (diff) | |
| parent | change toggle text, "enabled" -> "disable" (diff) | |
| download | rawaccel-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.cs | 17 |
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 |