Sha256: a868dd5ce1c76bb2e1ac1345c334c8cf0039a6414ac150d047c26a8c0b611ed4

Contents?: true

Size: 811 Bytes

Versions: 6

Compression:

Stored size: 811 Bytes

Contents

# frozen_string_literal: true

new({particle: :width })
new({particle: :height })
new({particle: :size }) do |params|
  atome_width = atome[:width]
  atome_height = atome[:height]
  aspect_ratio = atome_width / atome_height
  if atome_width > atome_height
    width(params)
    height(params / aspect_ratio)
  else
    width(params * aspect_ratio)
    height(params)
  end
end


# generator = Genesis.generator
#
# generator.build_particle(:width)
# generator.build_particle(:height)
# generator.build_particle(:size) do |params|
#   atome_width = atome[:width]
#   atome_height = atome[:height]
#   aspect_ratio = atome_width / atome_height
#   if atome_width > atome_height
#     width(params)
#     height(params / aspect_ratio)
#   else
#     width(params * aspect_ratio)
#     height(params)
#   end
# end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
atome-0.5.3.8.8 lib/atome/genesis/generators/geometry.rb
atome-0.5.3.8.1 lib/atome/genesis/generators/geometry.rb
atome-0.5.3.8.0 lib/atome/genesis/generators/geometry.rb
atome-0.5.3.7.8 lib/atome/genesis/generators/geometry.rb
atome-0.5.3.7.3 lib/atome/genesis/generators/geometry.rb
atome-0.5.3.7.2 lib/atome/genesis/generators/geometry.rb