Sha256: 3bf6263ec501fc6f1f3977594214c911452a97feeff5de592559c70dc8c5d335

Contents?: true

Size: 844 Bytes

Versions: 231

Compression:

Stored size: 844 Bytes

Contents

require 'mini_magick'
require_relative 'editor'

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

231 entries across 231 versions & 1 rubygems

Version Path
fastlane-2.113.0.beta.20190103200013 frameit/lib/frameit/mac_editor.rb
fastlane-2.113.0.beta.20190102200016 frameit/lib/frameit/mac_editor.rb
fastlane-2.113.0.beta.20190101200013 frameit/lib/frameit/mac_editor.rb
fastlane-2.113.0.beta.20181231200027 frameit/lib/frameit/mac_editor.rb
fastlane-2.113.0.beta.20181230200014 frameit/lib/frameit/mac_editor.rb
fastlane-2.113.0.beta.20181229200101 frameit/lib/frameit/mac_editor.rb
fastlane-2.113.0.beta.20181228200027 frameit/lib/frameit/mac_editor.rb
fastlane-2.113.0.beta.20181227200058 frameit/lib/frameit/mac_editor.rb
fastlane-2.113.0.beta.20181226200116 frameit/lib/frameit/mac_editor.rb
fastlane-2.113.0.beta.20181225200026 frameit/lib/frameit/mac_editor.rb
fastlane-2.113.0.beta.20181224200038 frameit/lib/frameit/mac_editor.rb
fastlane-2.113.0.beta.20181223200038 frameit/lib/frameit/mac_editor.rb
fastlane-2.113.0.beta.20181222200027 frameit/lib/frameit/mac_editor.rb
fastlane-2.113.0.beta.20181221200014 frameit/lib/frameit/mac_editor.rb
fastlane-2.113.0.beta.20181220200101 frameit/lib/frameit/mac_editor.rb
fastlane-2.113.0.beta.20181219200044 frameit/lib/frameit/mac_editor.rb
fastlane-2.112.0 frameit/lib/frameit/mac_editor.rb
fastlane-2.112.0.beta.20181218200038 frameit/lib/frameit/mac_editor.rb
fastlane-2.112.0.beta.20181217200025 frameit/lib/frameit/mac_editor.rb
fastlane-2.112.0.beta.20181216200018 frameit/lib/frameit/mac_editor.rb