Sha256: 9ffe500d72e8843ebb4c640da2fd5e3b177c4062338d6f261db42711784140e8

Contents?: true

Size: 851 Bytes

Versions: 426

Compression:

Stored size: 851 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 is_complex_framing_mode?
      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

426 entries across 426 versions & 5 rubygems

Version Path
fastlane-2.124.0.beta.20190516200101 frameit/lib/frameit/mac_editor.rb
fastlane-2.124.0.beta.20190515200049 frameit/lib/frameit/mac_editor.rb
fastlane-2.123.0 frameit/lib/frameit/mac_editor.rb
fastlane-2.123.0.beta.20190514200021 frameit/lib/frameit/mac_editor.rb
fastlane-2.123.0.beta.20190513200032 frameit/lib/frameit/mac_editor.rb
fastlane-2.123.0.beta.20190512200017 frameit/lib/frameit/mac_editor.rb
fastlane-2.123.0.beta.20190511200023 frameit/lib/frameit/mac_editor.rb
fastlane-2.123.0.beta.20190510200014 frameit/lib/frameit/mac_editor.rb
fastlane-2.123.0.beta.20190509200030 frameit/lib/frameit/mac_editor.rb
fastlane-2.123.0.beta.20190508200056 frameit/lib/frameit/mac_editor.rb
fastlane-2.123.0.beta.20190507200014 frameit/lib/frameit/mac_editor.rb
fastlane-2.123.0.beta.20190506200027 frameit/lib/frameit/mac_editor.rb
fastlane-2.123.0.beta.20190505200037 frameit/lib/frameit/mac_editor.rb
fastlane-2.123.0.beta.20190504200051 frameit/lib/frameit/mac_editor.rb
fastlane-2.122.0 frameit/lib/frameit/mac_editor.rb
fastlane-2.122.0.beta.20190502200046 frameit/lib/frameit/mac_editor.rb
fastlane-2.122.0.beta.20190501200015 frameit/lib/frameit/mac_editor.rb
fastlane-2.122.0.beta.20190430200043 frameit/lib/frameit/mac_editor.rb
fastlane-2.122.0.beta.20190429200122 frameit/lib/frameit/mac_editor.rb
fastlane-2.122.0.beta.20190428200018 frameit/lib/frameit/mac_editor.rb