Skip to content

Commit 39bc1fa

Browse files
committed
Use submodule and comply to recent OTD rename
1 parent 191fd23 commit 39bc1fa

4 files changed

Lines changed: 13 additions & 9 deletions

File tree

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule ".modules/OpenTabletDriver"]
2+
path = .modules/OpenTabletDriver
3+
url = https://github.com/InfinityGhost/OpenTabletDriver

.modules/OpenTabletDriver

Submodule OpenTabletDriver added at 3c52010

TabletDriverFilters/TabletDriverFilters.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<TargetFramework>netcoreapp3.1</TargetFramework>
55
</PropertyGroup>
66

7-
<ItemGroup>
8-
<PackageReference Include="TabletDriverPlugin" Version="0.3.0" />
7+
<ItemGroup>
8+
<ProjectReference Include="../.modules/OpenTabletDriver/OpenTabletDriver.Plugin/OpenTabletDriver.Plugin.csproj" />
99
</ItemGroup>
1010

1111
</Project>

TabletDriverFilters/TabletFilterSmoothing.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
2-
using TabletDriverPlugin;
3-
using TabletDriverPlugin.Attributes;
4-
using TabletDriverPlugin.Tablet;
2+
using System.Numerics;
3+
using OpenTabletDriver.Plugin.Attributes;
4+
using OpenTabletDriver.Plugin.Tablet;
55

66
namespace TabletDriverFilters
77
{
@@ -11,11 +11,11 @@ namespace TabletDriverFilters
1111
public class TabletFilterSmoothing : IFilter
1212
{
1313
private DateTime? _lastFilterTime;
14-
private Point _lastPos;
14+
private Vector2 _lastPos;
1515
private float _timerInterval;
1616
private const float _threshold = 0.63f;
1717

18-
public Point Filter(Point point)
18+
public Vector2 Filter(Vector2 point)
1919
{
2020
var timeDelta = DateTime.Now - _lastFilterTime;
2121
// If a time difference hasn't been established or it has been 100 milliseconds since the last filter
@@ -26,7 +26,7 @@ public Point Filter(Point point)
2626
}
2727
else
2828
{
29-
Point pos = new Point(_lastPos.X, _lastPos.Y);
29+
Vector2 pos = new Vector2(_lastPos.X, _lastPos.Y);
3030
float deltaX = point.X - _lastPos.X;
3131
float deltaY = point.Y - _lastPos.Y;
3232

@@ -41,7 +41,7 @@ public Point Filter(Point point)
4141
}
4242
}
4343

44-
private void SetPreviousState(Point lastPosition)
44+
private void SetPreviousState(Vector2 lastPosition)
4545
{
4646
_lastPos = lastPosition;
4747
_lastFilterTime = DateTime.Now;

0 commit comments

Comments
 (0)