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.117.0.beta.20190214200107 frameit/lib/frameit/mac_editor.rb
fastlane-2.117.0.beta.20190213200055 frameit/lib/frameit/mac_editor.rb
fastlane-2.117.0.beta.20190212200112 frameit/lib/frameit/mac_editor.rb
fastlane-2.117.0.beta.20190211200054 frameit/lib/frameit/mac_editor.rb
fastlane-2.117.0.beta.20190210200028 frameit/lib/frameit/mac_editor.rb
fastlane-2.117.0.beta.20190209200055 frameit/lib/frameit/mac_editor.rb
fastlane-2.117.0.beta.20190208200116 frameit/lib/frameit/mac_editor.rb
fastlane-2.117.0.beta.20190207200055 frameit/lib/frameit/mac_editor.rb
fastlane-2.116.0 frameit/lib/frameit/mac_editor.rb
fastlane-2.116.0.beta.20190206200014 frameit/lib/frameit/mac_editor.rb
fastlane-2.116.0.beta.20190205200046 frameit/lib/frameit/mac_editor.rb
fastlane-2.116.0.beta.20190204200009 frameit/lib/frameit/mac_editor.rb
fastlane-2.116.0.beta.20190203200034 frameit/lib/frameit/mac_editor.rb
fastlane-2.116.0.beta.20190202200022 frameit/lib/frameit/mac_editor.rb
fastlane-2.116.0.beta.20190201200019 frameit/lib/frameit/mac_editor.rb
fastlane-2.116.0.beta.20190131200016 frameit/lib/frameit/mac_editor.rb
fastlane-2.116.0.beta.20190130200045 frameit/lib/frameit/mac_editor.rb
fastlane-2.116.0.beta.20190129200025 frameit/lib/frameit/mac_editor.rb
fastlane-2.116.0.beta.20190128200102 frameit/lib/frameit/mac_editor.rb
fastlane-2.115.0 frameit/lib/frameit/mac_editor.rb