Skip to content

Commit

Permalink
fix(rubocop): fix lines that were too long
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanecopin committed Feb 21, 2019
1 parent 0210560 commit 713a2e5
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions lib/ios_icon_generator/helpers/mask_icon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ def self.mask_icon(
icon_output = "#{File.basename(image['filename'], extension)}-#{mask[:suffix]}#{extension}"
icon_output_path = File.join(output_folder, icon_output)

draw_shape_parameters = "-strokewidth '#{(mask[:stroke_width_offset] || 0) * [width, height].min}' -stroke '#{mask[:stroke_width_offset].zero? ? 'none' : (mask[:stroke_color] || '#000000')}' -fill '#{mask[:background_color] || '#FFFFFF'}'"
draw_shape_parameters = "-strokewidth '#{(mask[:stroke_width_offset] || 0) * [width, height].min}' \
-stroke '#{mask[:stroke_width_offset].zero? ? 'none' : (mask[:stroke_color] || '#000000')}' \
-fill '#{mask[:background_color] || '#FFFFFF'}'"
draw_shape =
case mask[:shape]
when :triangle
Expand All @@ -120,9 +122,20 @@ def self.mask_icon(

draw_symbol =
if mask[:file]
"\\( -background none -density 1536 -resize #{width * mask[:size_offset]}x#{height} \"#{mask[:file]}\" -geometry +#{width * mask[:x_offset]}+#{height * mask[:y_offset]} \\) -gravity southwest -composite"
"\\( -background none \
-density 1536 \
-resize #{width * mask[:size_offset]}x#{height} \
\"#{mask[:file]}\" \
-geometry +#{width * mask[:x_offset]}+#{height * mask[:y_offset]} \\) \
-gravity southwest \
-composite"
else
"-strokewidth 0 -stroke none -fill '#{mask[:symbol_color] || '#7F0000'}' -font '#{mask[:font]}' -pointsize #{height * mask[:size_offset] * 2.0} -annotate +#{width * mask[:x_offset]}+#{height - height * mask[:y_offset]} '#{mask[:symbol]}'"
"-strokewidth 0 \
-stroke none \
-fill '#{mask[:symbol_color] || '#7F0000'}' \
-font '#{mask[:font]}' \
-pointsize #{height * mask[:size_offset] * 2.0} \
-annotate +#{width * mask[:x_offset]}+#{height - height * mask[:y_offset]} '#{mask[:symbol]}'"
end
system("convert '#{File.join(appiconset_path, image['filename'])}' #{draw_shape_parameters} #{draw_shape} #{draw_symbol} '#{icon_output_path}'")

Expand Down

0 comments on commit 713a2e5

Please sign in to comment.