Sha256: 4a0f0ae1fc1cc60c8b5fa926e498edb7618a31fc31321f5a07fffaf44f8e7922

Contents?: true

Size: 793 Bytes

Versions: 470

Compression:

Stored size: 793 Bytes

Contents

module Frameit
  # Responsible for framing Mac Screenshots
  class MacEditor < Editor
    def prepare_image
      image = super
      image.resize("#{offset['width']}x") if offset['width']
    end

    def put_device_into_background(background)
      self.top_space_above_device = offset['titleHeight'] # needed for centering the title

      @image = background.composite(image, "png") do |c|
        c.compose "Over"
        c.geometry offset['offset']
      end

      return image
    end

    def load_frame
      nil # Macs don't need frames - backgrounds only
    end

    def should_add_title?
      true # Mac screenshots always need a background
    end

    def generate_background
      MiniMagick::Image.open(fetch_config['background']) # no resizing on the Mac
    end
  end
end

Version data entries

470 entries across 470 versions & 2 rubygems

Version Path
fastlane-2.74.0.beta.20180106010004 frameit/lib/frameit/mac_editor.rb
fastlane-2.73.0 frameit/lib/frameit/mac_editor.rb
fastlane-2.73.0.beta.20180105010003 frameit/lib/frameit/mac_editor.rb
fastlane-2.73.0.beta.20180104010004 frameit/lib/frameit/mac_editor.rb
fastlane-2.73.0.beta.20180103010003 frameit/lib/frameit/mac_editor.rb
fastlane-2.72.0 frameit/lib/frameit/mac_editor.rb
fastlane-2.72.0.beta.20180102010003 frameit/lib/frameit/mac_editor.rb
fastlane-2.72.0.beta.20180101010003 frameit/lib/frameit/mac_editor.rb
fastlane-2.72.0.beta.20171231010003 frameit/lib/frameit/mac_editor.rb
fastlane-2.71.1 frameit/lib/frameit/mac_editor.rb
fastlane-2.72.0.beta.20171230010003 frameit/lib/frameit/mac_editor.rb
fastlane-2.72.0.beta.20171229010003 frameit/lib/frameit/mac_editor.rb
fastlane-2.72.0.beta.20171228010004 frameit/lib/frameit/mac_editor.rb
fastlane-2.71.0 frameit/lib/frameit/mac_editor.rb
fastlane-2.71.0.beta.20171227010004 frameit/lib/frameit/mac_editor.rb
fastlane-2.71.0.beta.20171226010004 frameit/lib/frameit/mac_editor.rb
fastlane-2.71.0.beta.20171225010003 frameit/lib/frameit/mac_editor.rb
fastlane-2.71.0.beta.20171224010003 frameit/lib/frameit/mac_editor.rb
fastlane-2.71.0.beta.20171223010003 frameit/lib/frameit/mac_editor.rb
fastlane-2.71.0.beta.20171222010003 frameit/lib/frameit/mac_editor.rb