Class: Krupuk::CutMarks

Inherits:
Object
  • Object
show all
Defined in:
lib/krupuk/cut_marks.rb

Constant Summary collapse

TICK =
18

Class Method Summary collapse

Class Method Details

.draw(pdf, x, y, config) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/krupuk/cut_marks.rb', line 7

def self.draw(pdf, x, y, config)
  w = config.card_width
  h = config.card_height

  pdf.stroke_color("000000")
  pdf.line_width(1)
  pdf.transparent(0.3) do
    pdf.stroke_line([x,     y + h], [x + TICK, y + h])
    pdf.stroke_line([x,     y + h], [x,        y + h - TICK])

    pdf.stroke_line([x + w, y + h], [x + w - TICK, y + h])
    pdf.stroke_line([x + w, y + h], [x + w,        y + h - TICK])

    pdf.stroke_line([x,     y], [x + TICK, y])
    pdf.stroke_line([x,     y], [x,        y + TICK])

    pdf.stroke_line([x + w, y], [x + w - TICK, y])
    pdf.stroke_line([x + w, y], [x + w,        y + TICK])
  end
end