public
Description: Fast, Nimble PDF Writer for Ruby
Homepage: http://prawn.majesticseacreature.com
Clone URL: git://github.com/sandal/prawn.git
Partial fix
sandal (author)
Thu Jul 24 10:35:50 -0700 2008
commit  97d9bf083fd9423d17fd1efca36ea675ff34a6d7
tree    646e48b29ad7b0ff18ae11267c721e5a2437fe7d
parent  6d84ac4ba0587ce6991a46c6b1105a55a296dc37
...
30
31
32
33
 
34
35
36
 
37
38
39
...
30
31
32
 
33
34
35
 
36
37
38
39
0
@@ -30,10 +30,10 @@ Prawn::Document.generate("table_with_background_color_problems.pdf") do
0
          [ "It",    "Rules",             "4" ],     
0
          [ "It",    "Rules",             "4" ]],     
0
 
0
-    :font_size  => 24
0
+    :font_size  => 10
0
     :horizontal_padding => 10,
0
     :vertical_padding => 3,
0
-    :border     => 2,
0
+    :border     => 1,
0
     :position   => :center,
0
     :headers    => ["Column A","Column B","#"],
0
     :row_colors => ["eeeeee"]
...
183
184
185
186
187
 
 
 
 
 
 
 
 
 
 
 
 
 
188
189
190
...
208
209
210
 
 
 
 
211
212
213
...
183
184
185
 
 
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
...
219
220
221
222
223
224
225
226
227
228
0
@@ -183,8 +183,19 @@ module Prawn
0
           @document.stroke_color @background_color
0
 
0
           @document.canvas do
0
-            @document.fill_and_stroke_rectangle [x+border,y-border], 
0
-              width-2*border, height-2*border
0
+            case border_style
0
+            when :all
0
+              point = [x,y-border]
0
+              h = height - border
0
+            when :no_top
0
+              point = [x,y-border/2.0]  
0
+              h     = height - border / 2.0
0
+            else
0
+              point = [x,y-border/2.0]
0
+              h     = height
0
+           end
0
+                    
0
+            @document.fill_and_stroke_rectangle point, width, h
0
           end
0
 
0
           @document.fill_color old_fill_color || "000000"
0
@@ -208,6 +219,10 @@ module Prawn
0
 
0
       def border_style=(s)
0
         @cells.each { |e| e.border_style = s }
0
+      end                 
0
+      
0
+      def border_style
0
+        @cells[0].border_style
0
       end
0
 
0
     end

Comments