Class: Frameit::MacEditor
Overview
Responsible for framing Mac Screenshots
Instance Attribute Summary
Attributes inherited from Editor
#frame, #image, #screenshot, #top_space_above_device
Instance Method Summary
collapse
Methods inherited from Editor
#frame!
Instance Method Details
#generate_background ⇒ Object
28
29
30
|
# File 'lib/frameit/mac_editor.rb', line 28
def generate_background
MiniMagick::Image.open(fetch_config['background']) end
|
#load_frame ⇒ Object
20
21
22
|
# File 'lib/frameit/mac_editor.rb', line 20
def load_frame
nil end
|
#prepare_image ⇒ Object
4
5
6
7
|
# File 'lib/frameit/mac_editor.rb', line 4
def prepare_image
image = super
image.resize("#{offset['width']}x") if offset['width']
end
|
#put_device_into_background(background) ⇒ Object
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/frameit/mac_editor.rb', line 9
def put_device_into_background(background)
self.top_space_above_device = offset['titleHeight']
@image = background.composite(image, "png") do |c|
c.compose "Over"
c.geometry offset['offset']
end
return image
end
|
#should_add_title? ⇒ Boolean
24
25
26
|
# File 'lib/frameit/mac_editor.rb', line 24
def should_add_title?
true end
|