Module: Prune::Functions

Included in:
Elements::Base, Parsers::Base, Shapes::Base
Defined in:
lib/prune/functions.rb

Instance Method Summary collapse

Instance Method Details

#mm_to_pt(mm) ⇒ Object

Convert millimeter to points.



6
7
8
9
# File 'lib/prune/functions.rb', line 6

def mm_to_pt(mm)
  pt = mm * 72.0 / 25.4
  (pt * 100).round / 100.0
end

#pt_to_mm(pt) ⇒ Object

Convert points to millimeter.



12
13
14
15
# File 'lib/prune/functions.rb', line 12

def pt_to_mm(pt)
  mm = pt * 25.4 / 72.0
  (mm * 100).round / 100.0
end