Skip to content

Commit

Permalink
fix(pinch_detector)!: Reverse pinch in/out
Browse files Browse the repository at this point in the history
- fix pinch in/out logic to reverse the behavior

BREAKING CHANGE: Reverse pinch in/out
  • Loading branch information
iberianpig committed Mar 25, 2023
1 parent 454f0fe commit aa46ae1
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/fusuma/plugin/detectors/pinch_detector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ def detect(buffers)
def create_repeat_index(gesture:, finger:, direction:, status:)
Config::Index.new(
[
Config::Index::Key.new(gesture),
Config::Index::Key.new(finger.to_i),
Config::Index::Key.new(direction, skippable: true),
Config::Index::Key.new(status)
Config::Index::Key.new(gesture), # 'pinch'
Config::Index::Key.new(finger.to_i), # 2, 3, 4
Config::Index::Key.new(direction, skippable: true), # 'in', 'out'
Config::Index::Key.new(status) # 'begin', 'update', 'end'
]
)
end
Expand All @@ -115,9 +115,9 @@ def create_repeat_index(gesture:, finger:, direction:, status:)
def create_oneshot_index(gesture:, finger:, direction:)
Config::Index.new(
[
Config::Index::Key.new(gesture),
Config::Index::Key.new(finger.to_i, skippable: true),
Config::Index::Key.new(direction)
Config::Index::Key.new(gesture), # 'pinch'
Config::Index::Key.new(finger.to_i, skippable: true), # 2, 3, 4
Config::Index::Key.new(direction) # 'in', 'out'
]
)
end
Expand Down Expand Up @@ -161,9 +161,9 @@ def to_s

def calc
if @target > @base
IN
else
OUT
else
IN
end
end
end
Expand Down

0 comments on commit aa46ae1

Please sign in to comment.