Class: Prawn::Table::Cell

Inherits:
Object
  • Object
show all
Defined in:
lib/booky/layout/base/code.rb

Overview

Prawn defines its table cell backgrounds not quite high enough. So without this adaption there are visible lines between table cells when you give them a dark background color.

Instance Method Summary collapse

Instance Method Details

#draw_background(pt) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/booky/layout/base/code.rb', line 6

def draw_background(pt)
  if @background_color
    @pdf.mask(:fill_color) do

      @pdf.fill_color @background_color
      if Booky::Layout.config.patch_table_cell
        @pdf.fill_rectangle [pt[0], pt[1] + @padding[2]], width, height + @padding[2]
      else
        @pdf.fill_rectangle pt, width, height
      end
    end
  end
end