File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -145,19 +145,20 @@ protected override void ConsumeState()
145145 else
146146 calcTarget = targetPos ;
147147 }
148+ else
149+ {
150+ OnEmit ( ) ;
151+ }
148152 }
149153
150154 protected override void UpdateState ( )
151155 {
152- if ( State is ITabletReport report )
156+ if ( State is ITabletReport report && PenIsInRange ( ) )
153157 {
154158 report . Position = Filter ( calcTarget ) / MillimeterScale ;
155159 report . Pressure = this . pressure ;
156160 State = report ;
157- }
158161
159- if ( PenIsInRange ( ) || State is not ITabletReport )
160- {
161162 OnEmit ( ) ;
162163 }
163164 }
Original file line number Diff line number Diff line change @@ -37,20 +37,21 @@ protected override void ConsumeState()
3737 {
3838 if ( State is ITabletReport report )
3939 this . targetPos = new Vector3 ( report . Position , report . Pressure ) * mmScale ;
40+ else
41+ OnEmit ( ) ;
4042 }
4143
4244 protected override void UpdateState ( )
4345 {
44- if ( State is ITabletReport report )
46+ if ( State is ITabletReport report && PenIsInRange ( ) )
4547 {
4648 var newPoint = Filter ( this . targetPos ) / mmScale ;
4749 report . Position = new Vector2 ( newPoint . X , newPoint . Y ) ;
4850 report . Pressure = ( uint ) newPoint . Z ;
4951 State = report ;
50- }
5152
52- if ( PenIsInRange ( ) || State is not ITabletReport )
5353 OnEmit ( ) ;
54+ }
5455 }
5556
5657 public Vector3 Filter ( Vector3 point )
You can’t perform that action at this time.
0 commit comments