diff options
| -rw-r--r-- | grapher/Models/Calculations/AccelChartData.cs | 3 | ||||
| -rw-r--r-- | grapher/Models/Mouse/MouseWatcher.cs | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/grapher/Models/Calculations/AccelChartData.cs b/grapher/Models/Calculations/AccelChartData.cs index 60d4c89..48374c1 100644 --- a/grapher/Models/Calculations/AccelChartData.cs +++ b/grapher/Models/Calculations/AccelChartData.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; namespace grapher.Models.Calculations @@ -80,6 +81,8 @@ namespace grapher.Models.Calculations public int GetVelocityIndex(double outVelocityValue) { + Debug.Assert(outVelocityValue >= 0); + var log = Math.Log10(outVelocityValue); if (log < -2) { diff --git a/grapher/Models/Mouse/MouseWatcher.cs b/grapher/Models/Mouse/MouseWatcher.cs index 66e72bb..68b56e5 100644 --- a/grapher/Models/Mouse/MouseWatcher.cs +++ b/grapher/Models/Mouse/MouseWatcher.cs @@ -741,7 +741,9 @@ namespace grapher.Models.Mouse PollTimeRecip = Math.Abs(SettingsManager.PollRateField.Data) / 1000; } - if (rawInput.Data.Mouse.LastX != 0 || rawInput.Data.Mouse.LastY != 0) + bool relative = !rawInput.Data.Mouse.Flags.HasFlag(RawMouseFlags.MoveAbsolute); + + if (relative && (rawInput.Data.Mouse.LastX != 0 || rawInput.Data.Mouse.LastY != 0)) { double x = rawInput.Data.Mouse.LastX; double y = rawInput.Data.Mouse.LastY; |