<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -7,7 +7,7 @@
 # Because this almost appears to be a feature display-wise, we will leave it 
 # alone for now.
 
-$LOAD_PATH &lt;&lt; File.join(File.dirname(__FILE__), '..', 'lib')
+$LOAD_PATH &lt;&lt; File.join(File.dirname(__FILE__), '..', '..', 'lib')
 require &quot;prawn&quot;
 
 Prawn::Document.generate(&quot;table_with_background_color_problems.pdf&quot;) do 
@@ -41,7 +41,7 @@ Prawn::Document.generate(&quot;table_with_background_color_problems.pdf&quot;) do
     :border     =&gt; 1,
     :position   =&gt; :center,
     :headers    =&gt; [&quot;Column A&quot;,&quot;Column B&quot;,&quot;#&quot;],
-    :row_colors =&gt; [&quot;eeeeee&quot;]
+    :row_colors =&gt; [&quot;cccccc&quot;]
 
   pad(20) do
     text &quot;This should appear in the original font size&quot;</diff>
      <filename>bugs/resolved/table_row_background_color_issue.rb</filename>
    </modified>
    <modified>
      <diff>@@ -48,7 +48,8 @@ module Prawn
         @text         = options[:text]
         @width        = options[:width]
         @border       = options[:border]
-        @border_style = options[:border_style] || :all
+        @border_style = options[:border_style] || :all               
+        @background_color = options[:background_color]
 
         @horizontal_padding = options[:horizontal_padding] || 0
         @vertical_padding   = options[:vertical_padding]   || 0
@@ -58,7 +59,7 @@ module Prawn
         end
       end
 
-      attr_accessor :point, :border_style, :border
+      attr_accessor :point, :border_style, :border, :background_color
       attr_writer   :height #:nodoc:
 
       # The width of the text area excluding the horizonal padding
@@ -96,6 +97,16 @@ module Prawn
         if @border
           @document.mask(:line_width) do
             @document.line_width = @border
+            
+            if @background_color    
+              @document.mask(:fill_color) do
+                @document.fill_color @background_color  
+                h  = borders.include?(:bottom) ? height - border : height + border / 2.0
+                @document.fill_rectangle [rel_point[0] + border / 2.0, 
+                                          rel_point[1] - border / 2.0 ], 
+                    width - border, h  
+              end
+            end 
 
             if borders.include?(:left)
               @document.stroke_line [rel_point[0], rel_point[1] + (@border / 2.0)], 
@@ -166,7 +177,7 @@ module Prawn
 
       def &lt;&lt;(cell)
         @cells &lt;&lt; cell
-        @height = cell.height if cell.height &gt; @height
+        @height = cell.height if cell.height &gt; @height 
         @width += cell.width
         self
       end
@@ -175,36 +186,11 @@ module Prawn
         y = @document.y
         x = @document.bounds.absolute_left
 
-        # TODO: This is a bit of a hack and can be cleaned up
-        if @background_color
-
-          @document.mask(:fill_color, :stroke_color) do
-            @document.fill_color = @background_color
-            @document.stroke_color = @background_color
-
-            @document.canvas do
-              case border_style
-              when :all
-                point = [x,y-border]
-                h = height - border
-              when :no_top
-                point = [x,y-border/2.0]  
-                h     = height - border / 2.0
-              else
-                point = [x,y-border/2.0]
-                h     = height
-             end
-                    
-              @document.fill_and_stroke_rectangle point, width, h
-            end
-          end   
-
-        end
-
         @cells.each do |e|
           e.point  = [x - @document.bounds.absolute_left, 
                       y - @document.bounds.absolute_bottom]
           e.height = @height
+          e.background_color = @background_color
           e.draw
           x += e.width
         end</diff>
      <filename>lib/prawn/graphics/cell.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>3867937e578440e363e0f67f927adf006228450a</id>
    </parent>
  </parents>
  <author>
    <name>Gregory Brown</name>
    <email>gregory.t.brown@gmail.com</email>
  </author>
  <url>http://github.com/sandal/prawn/commit/01215f4107607a2431361b5df55221a60c204e8e</url>
  <id>01215f4107607a2431361b5df55221a60c204e8e</id>
  <committed-date>2008-07-24T13:44:28-07:00</committed-date>
  <authored-date>2008-07-24T13:42:56-07:00</authored-date>
  <message>Draw backgrounds by cell</message>
  <tree>d59b8dfcffd619aebb096eb29bf46d2977bd6425</tree>
  <committer>
    <name>Gregory Brown</name>
    <email>gregory.t.brown@gmail.com</email>
  </committer>
</commit>
