Class: PPTXMarkdown::ShapeMapper

Inherits:
Object
  • Object
show all
Defined in:
lib/pptx_markdown/shape_mapper.rb

Constant Summary collapse

EMU =

1pt to English Metric Units

12_700
MARGIN =

Space between shapes

25
Y_SIZE =

Shape height

30
X_SIZE =

Shape width

670

Instance Method Summary collapse

Instance Method Details

#nextObject



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/pptx_markdown/shape_mapper.rb', line 17

def next
  factor = collection.next

  OpenStruct.new(
    {
      x: MARGIN,
      y: (MARGIN + Y_SIZE) * factor + MARGIN,
      cx: X_SIZE,
      cy: (MARGIN * 2) + (Y_SIZE * 2)
    }.map { |k, v| [k, v * EMU] }.to_h
  )
end