summaryrefslogtreecommitdiff
path: root/grapher
diff options
context:
space:
mode:
Diffstat (limited to 'grapher')
-rw-r--r--grapher/Form1.cs17
-rw-r--r--grapher/Models/AccelGUI.cs4
-rw-r--r--grapher/Models/Serialized/RawAccelSettings.cs1
3 files changed, 16 insertions, 6 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
diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs
index 5cd7012..3a30a9b 100644
--- a/grapher/Models/AccelGUI.cs
+++ b/grapher/Models/AccelGUI.cs
@@ -71,7 +71,6 @@ namespace grapher
}
SetupButtons();
- AccelForm.DoResize();
// TODO: The below removes an overlapping form from the anisotropy panel.
// Figure out why and remove the overlap and below.
@@ -144,6 +143,7 @@ namespace grapher
var settings = new DriverSettings
{
rotation = ApplyOptions.Rotation.Field.Data,
+ snap = driverSettings.snap,
sensitivity = new Vec2<double>
{
x = ApplyOptions.Sensitivity.Fields.X,
@@ -229,7 +229,7 @@ namespace grapher
ToggleButton.Checked = LastToggleChecked;
ToggleButton.Font = DefaultButtonFont;
- ToggleButton.Text = ToggleButton.Checked ? "Enabled" : "Disabled";
+ ToggleButton.Text = ToggleButton.Checked ? "Disable" : "Enable";
ToggleButton.Update();
WriteButton.Font = DefaultButtonFont;
diff --git a/grapher/Models/Serialized/RawAccelSettings.cs b/grapher/Models/Serialized/RawAccelSettings.cs
index f4fb1e2..17db910 100644
--- a/grapher/Models/Serialized/RawAccelSettings.cs
+++ b/grapher/Models/Serialized/RawAccelSettings.cs
@@ -131,6 +131,7 @@ namespace grapher.Models.Serialized
accelSettings.directionalMultipliers.x <= 0 &&
accelSettings.directionalMultipliers.y <= 0 &&
accelSettings.rotation == 0 &&
+ accelSettings.snap == 0 &&
accelSettings.modes.x == AccelMode.noaccel &&
wholeOrNoY;
}