lib/frameit/offsets.rb in frameit-2.2.2 vs lib/frameit/offsets.rb in frameit-2.3.0
- old
+ new
@@ -1,9 +1,10 @@
module Frameit
class Offsets
# Returns the image offset needed for a certain device type for a given orientation
# uses deliver to detect the screen size
+ # rubocop:disable Metrics/MethodLength
def self.image_offset(screenshot)
size = Deliver::AppScreenshot::ScreenSize
case screenshot.orientation_name
when Orientation::PORTRAIT
case screenshot.screen_size
@@ -30,10 +31,15 @@
when size::IOS_IPAD
return {
'offset' => '+47+135',
'width' => 737
}
+ when size::IOS_IPAD_PRO
+ return {
+ 'offset' => '+48+90',
+ 'width' => 805
+ }
end
when Orientation::LANDSCAPE
case screenshot.screen_size
when size::IOS_55
return {
@@ -58,10 +64,16 @@
when size::IOS_IPAD
return {
'offset' => '+135+47',
'width' => 983
}
+ when size::IOS_IPAD_PRO
+ return {
+ 'offset' => '+88+48',
+ 'width' => 1075
+ }
end
end
end
+ # rubocop:enable Metrics/MethodLength
end
end