Sha256: 5d84405a217635159fd0f5c3d412e6dea811ee4c53d2b76f56babf651c5fae2a

Contents?: true

Size: 1.38 KB

Versions: 58

Compression:

Stored size: 1.38 KB

Contents

# frozen_string_literal: true

# new({ method: :width, type: :integer, renderer: :html }) do |value, _user_proc|
#   unit_found = metrics[:width]
#   if unit_found
#     html.style(:width, "#{value}#{unit_found}")
#   elsif value.is_a?(Numeric)
#     html.style(:width, "#{value}px")
#   else
#     html.style(:width, value)
#   end
# end
#
# new({ method: :height, renderer: :html, type: :string }) do |value, _user_proc|
#   unit_found = metrics,
#     [:height]
#   if unit_found
#     html.style(:height, "#{value}#{unit_found}")
#   elsif value.is_a?(Numeric)
#     html.style(:height, "#{value}px")
#   else
#     html.style(:height, value)
#   end
# end

new({ method: :width, renderer: :html, type: :int }) do |params, _user_proc|
  unit = @unit[:width] || :px if params.is_a? Numeric
  js[:style][:width] = "#{params}#{unit}"
end

new({ method: :height, renderer: :html, type: :int }) do |params, _user_proc|
  unit = @unit[:height] || :px if params.is_a? Numeric
  js[:style][:height] = "#{params}#{unit}"
end


# new({ method: :size, type: :hash, renderer: :html }) do |value, _user_proc|
#   # html.style('fontSize',"#{value}px")
# end
#
#
# new({ method: :size, type: :int, renderer: :html }) do |value, _user_proc|
#   # html.style('fontSize', "#{value}px")
# end


new({ method: :size, type: :int, renderer: :html, specific: :text }) do |value, _user_proc|
  html.style('fontSize', "#{value}px")
end

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
atome-0.5.7.3.9 lib/renderers/html/geometry.rb
atome-0.5.7.3.6 lib/renderers/html/geometry.rb
atome-0.5.7.3.5 lib/renderers/html/geometry.rb
atome-0.5.7.3.3 lib/renderers/html/geometry.rb
atome-0.5.7.3.2 lib/renderers/html/geometry.rb
atome-0.5.7.3.1 lib/renderers/html/geometry.rb
atome-0.5.7.3.0 lib/renderers/html/geometry.rb
atome-0.5.7.1.8 lib/renderers/html/geometry.rb
atome-0.5.7.1.7 lib/renderers/html/geometry.rb
atome-0.5.7.1.0 lib/renderers/html/geometry.rb
atome-0.5.7.0.7 lib/renderers/html/geometry.rb
atome-0.5.7.0.5 lib/renderers/html/geometry.rb
atome-0.5.7.0.4 lib/renderers/html/geometry.rb
atome-0.5.7.0.3 lib/renderers/html/geometry.rb
atome-0.5.7.0.2 lib/renderers/html/geometry.rb
atome-0.5.6.8.7 lib/renderers/html/geometry.rb
atome-0.5.6.8.6 lib/renderers/html/geometry.rb
atome-0.5.6.8.5 lib/renderers/html/geometry.rb
atome-0.5.6.8.3 lib/renderers/html/geometry.rb
atome-0.5.6.7.8 lib/renderers/html/geometry.rb