Skip to content

Commit 4d4ae8e

Browse files
authored
Merge pull request #716 from JiepengTan/pr_fix_swipe_error
Remove swipe trajectory validation checking
2 parents 711e01c + 93ad3fc commit 4d4ae8e

2 files changed

Lines changed: 0 additions & 15 deletions

File tree

game.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,6 @@ func (p *Game) inputEventLoop(me coroutine.Thread) int {
872872
dx := mathfMousePos.X - lastMousePos.X
873873
dy := mathfMousePos.Y - lastMousePos.Y
874874
if math.Abs(dx) > mouseMovementThreshold || math.Abs(dy) > mouseMovementThreshold {
875-
p.mousePos = mathfMousePos // Update stored position
876875
p.inputs.onMouseMove(mathfMousePos)
877876
lastMousePos = mathfMousePos
878877
}

input.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -376,20 +376,6 @@ func (sr *inputSwipeRecognizer) checkForSwipeCompletion() bool {
376376
if idealDistance < sr.minimumDistance || idealDistance > sr.maximumDistance {
377377
return false
378378
}
379-
380-
// 3. Trajectory validation (ensure the path is not too curved)
381-
realDistance := 0.0
382-
for i := 1; i < len(sr.points); i++ {
383-
dx := sr.points[i].X - sr.points[i-1].X
384-
dy := sr.points[i].Y - sr.points[i-1].Y
385-
realDistance += math.Sqrt(dx*dx + dy*dy)
386-
}
387-
388-
// If real distance is more than 10% longer than ideal distance, it's too curved
389-
if realDistance > idealDistance*1.1 {
390-
return false
391-
}
392-
393379
// 4. Direction calculation
394380
direction := sr.calculateDirection(sr.startPoint, sr.endPoint)
395381

0 commit comments

Comments
 (0)