Sha256: 9ffe500d72e8843ebb4c640da2fd5e3b177c4062338d6f261db42711784140e8

Contents?: true

Size: 851 Bytes

Versions: 425

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

425 entries across 425 versions & 5 rubygems

Version Path
fastlane-2.225.0 frameit/lib/frameit/mac_editor.rb
fastlane-2.224.0 frameit/lib/frameit/mac_editor.rb
fastlane-2.223.1 frameit/lib/frameit/mac_editor.rb
fastlane-2.223.0 frameit/lib/frameit/mac_editor.rb
fastlane-2.222.0 frameit/lib/frameit/mac_editor.rb
fastlane-2.221.1 frameit/lib/frameit/mac_editor.rb
fastlane-2.221.0 frameit/lib/frameit/mac_editor.rb
fastlane-2.220.0 frameit/lib/frameit/mac_editor.rb
fastlane-2.219.0 frameit/lib/frameit/mac_editor.rb
fastlane-2.218.0 frameit/lib/frameit/mac_editor.rb
fastlane-security-patched-2.216.0 frameit/lib/frameit/mac_editor.rb
fastlane-2.217.0 frameit/lib/frameit/mac_editor.rb
fastlane-2.216.0 frameit/lib/frameit/mac_editor.rb
fastlane-2.215.1 frameit/lib/frameit/mac_editor.rb
fastlane-2.215.0 frameit/lib/frameit/mac_editor.rb
fastlane-mercafacil-2.214.0 frameit/lib/frameit/mac_editor.rb
fastlane-2.214.0 frameit/lib/frameit/mac_editor.rb
fastlane-2.213.0 frameit/lib/frameit/mac_editor.rb
fastlane-2.212.2 frameit/lib/frameit/mac_editor.rb
fastlane_pricing_fix-2.212.1 frameit/lib/frameit/mac_editor.rb