lib/calabash-cucumber/actions/instruments_actions.rb in calabash-cucumber-0.18.2 vs lib/calabash-cucumber/actions/instruments_actions.rb in calabash-cucumber-0.19.0.pre1
- old
+ new
@@ -114,20 +114,19 @@
# @!visibility private
def normalize_rect_for_orientation!(orientation, rect)
orientation = orientation.to_sym
launcher = Calabash::Cucumber::Launcher.launcher
+ device = launcher.device
# Coordinate translations for orientation is handled in the server for iOS 8+
- # https://developer.apple.com/library/ios/documentation/UIKit/Reference/UICoordinateSpace_protocol/index.html
- if launcher.ios_major_version.to_i >= 8
+ if device.ios_major_version.to_i >= 8
return
end
# We cannot use Device#screen_dimensions here because on iPads the height
# and width are the opposite of what we expect.
# @todo Move all coordinate/orientation translation into the server.
- device = launcher.device
if device.ipad?
screen_size = { :width => 768, :height => 1024 }
elsif device.iphone_4in?
screen_size = { :width => 320, :height => 568 }
else