prawn-layout 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -4,7 +4,7 @@ require 'rake/testtask'
4
4
  require "rake/rdoctask"
5
5
  require "rake/gempackagetask"
6
6
 
7
- PRAWN_LAYOUT_VERSION = "0.3.1"
7
+ PRAWN_LAYOUT_VERSION = "0.3.2"
8
8
 
9
9
  task :default => [:test]
10
10
 
@@ -16,6 +16,6 @@ module Prawn
16
16
  end
17
17
 
18
18
  module Layout
19
- VERSION = "0.3.1"
19
+ VERSION = "0.3.2"
20
20
  end
21
21
  end
@@ -167,13 +167,25 @@ module Prawn
167
167
  when :center
168
168
  x = (@document.bounds.width - width) / 2.0
169
169
  dy = @document.bounds.absolute_top - @document.y
170
+ final_pos = nil
171
+
170
172
  @document.bounding_box [x, @parent_bounds.top], :width => width do
171
173
  @document.move_down(dy)
172
174
  generate_table
175
+ final_pos = @document.y
173
176
  end
177
+
178
+ @document.y = final_pos
174
179
  when Numeric
175
- x, y = C(:position), @document.y - @document.bounds.absolute_bottom
176
- @document.bounding_box([x,y], :width => width) { generate_table }
180
+ x, y = C(:position), @document.cursor
181
+ final_pos = nil
182
+
183
+ @document.bounding_box([x,y], :width => width) do
184
+ generate_table
185
+ final_pos = @document.y
186
+ end
187
+
188
+ @document.y = final_pos
177
189
  else
178
190
  generate_table
179
191
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prawn-layout
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregory Brown
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-10 00:00:00 -05:00
12
+ date: 2009-11-17 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies: []
15
15