lib/prawn/table/cell.rb in prawn-table-0.2.1 vs lib/prawn/table/cell.rb in prawn-table-0.2.2
- old
+ new
@@ -708,14 +708,14 @@
end
# Draws the cell's background color.
#
def draw_background(pt)
- if defined?(@background_color) && @background_color
- @pdf.mask(:fill_color) do
- @pdf.fill_color @background_color
- @pdf.fill_rectangle pt, width, height
- end
+ return unless background_color
+
+ @pdf.mask(:fill_color) do
+ @pdf.fill_color background_color
+ @pdf.fill_rectangle pt, width, height
end
end
# Draws borders around the cell. Borders are centered on the bounds of
# the cell outside of any padding, so the caller is responsible for