Skip to content

Commit

Permalink
Merge pull request #4 from starman1108/patch-1
Browse files Browse the repository at this point in the history
fix error of touch point which lock size is (4,3)
  • Loading branch information
hsuanchih authored Nov 6, 2019
2 parents 112e009 + 216e9e3 commit ed4b5d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CCGestureLock/Classes/CCGestureLock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public class CCGestureLock: UIControl {
if let previousSelection = selectionPath.last {

let deltaIndex = abs(indexPath.item - previousSelection.item)
let deltaRows = abs(previousSelection.item/lockSize.numVerticalSensors - indexPath.item/lockSize.numVerticalSensors)
let deltaRows = abs(previousSelection.item/lockSize.numHorizontalSensors - indexPath.item/lockSize.numHorizontalSensors)
let divisor = deltaRows > 1 && deltaIndex%deltaRows == 0 ? deltaIndex/deltaRows : deltaIndex
updateSelectionPath(previousSelection.item, end: indexPath.item, increment: deltaRows == 0 ? 1 : divisor)

Expand Down

0 comments on commit ed4b5d1

Please sign in to comment.