Sha256: 2f7e0072b3b2875a32444bc02ecf39b99c1a1bd04c588f862e0b22f79aac1aa8
Contents?: true
Size: 566 Bytes
Versions: 8
Compression:
Stored size: 566 Bytes
Contents
module Prawn::Svg::Calculators class Pixels extend Prawn::Measurements def self.to_pixels(value, axis_length) if value.is_a?(String) if match = value.match(/\d(cm|dm|ft|in|m|mm|yd)$/) send("#{match[1]}2pt", value.to_f) elsif match = value.match(/\dpc$/) value.to_f * 15 # according to http://www.w3.org/TR/SVG11/coords.html elsif value[-1..-1] == "%" value.to_f * axis_length / 100.0 else value.to_f end elsif value value.to_f end end end end
Version data entries
8 entries across 8 versions & 1 rubygems