Method: Screen#swipe_coordinates

Defined in:
lib/icuke/screen.rb

#swipe_coordinates(direction) ⇒ Object



72
73
74
75
76
77
78
79
80
81
82
# File 'lib/icuke/screen.rb', line 72

def swipe_coordinates(direction)
  modifier = [:up, :left].include?(direction) ? -1 : 1
  x, y = center_coordinates
  x2, y2 = x, y
  if [:up, :down].include?(direction)
    y2 = y + (y * modifier)
  else
    x2 = x + (x * modifier)
  end
  return x, y, x2, y2
end