public
Description: Fast, Nimble PDF Writer for Ruby
Homepage: http://prawn.majesticseacreature.com
Clone URL: git://github.com/sandal/prawn.git
ugh
sandal (author)
Thu Nov 13 22:24:51 -0800 2008
commit  fadb65c303ff129d0b25a929d3b9d1f915b2f98d
tree    b5c26363828d3fee25b626cf5ec9a22d629a15bf
parent  a123f4980b03072593f14d33219a10c16cce50f3
...
12
13
14
15
 
16
17
 
18
19
20
...
12
13
14
 
15
16
 
17
18
19
20
0
@@ -12,8 +12,8 @@ Prawn::Document.generate("text_box.pdf") do
0
     :width    => 250, :height => font.height * 10,
0
     :overflow => :truncate,
0
     :at       => [50, 300]
0
-    
0
+  
0
   move_down 20
0
-
0
+  
0
   text_box "Oh hai text box. " * 100, :overflow => :expand
0
 end
0
\ No newline at end of file
...
20
21
22
 
23
24
25
26
27
 
 
 
28
29
30
 
 
 
 
31
32
33
...
20
21
22
23
24
25
26
 
 
27
28
29
30
31
 
32
33
34
35
36
37
38
0
@@ -20,14 +20,19 @@ module Prawn
0
           x,y = @at
0
           
0
           unless @overflow == :expand
0
+            original_y = @document.y
0
             fit_text_to_box
0
           end
0
           
0
-          @document.y = @document.bounds.absolute_bottom + y   
0
-          @document.span(@width, :position => x) do
0
+          @document.bounding_box([x,@document.bounds.top], 
0
+            :width => @width, :height => @document.bounds.height) do
0
+            @document.y = @document.bounds.absolute_bottom + y 
0
             @document.text @text
0
           end
0
-            
0
+          
0
+          unless @overflow == :expand
0
+            @document.y = y + @document.bounds.absolute_bottom - @height  
0
+          end        
0
         end
0
         
0
         private

Comments