class Prawn::SVG::Calculators::Pixels::Measurement
Public Class Methods
Source
# File lib/prawn/svg/calculators/pixels.rb, line 3 def self.to_pixels(value, axis_length = nil, font_size: Prawn::SVG::Properties::EM) if value.respond_to?(:to_pixels) value.to_pixels(axis_length, font_size) elsif value.is_a?(String) value = value.strip value = Prawn::SVG::Length.parse(value) || Prawn::SVG::Percentage.parse(value) value&.to_pixels(axis_length, font_size) || 0.0 elsif value value.to_f end end