lib/prawn/document/span.rb in prawn-2.0.1 vs lib/prawn/document/span.rb in prawn-2.0.2
- old
+ new
@@ -24,26 +24,26 @@
#
# span(350, :position => :center) do
# text "Here's some centered text in a 350 point column. " * 100
# end
#
- def span(width, options={})
+ def span(width, options = {})
Prawn.verify_options [:position], options
original_position = self.y
# FIXME: Any way to move this upstream?
left_boundary = case(options[:position] || :left)
- when :left
- margin_box.absolute_left
- when :center
- margin_box.absolute_left + margin_box.width / 2.0 - width / 2.0
- when :right
- margin_box.absolute_right - width
- when Numeric
- margin_box.absolute_left + options[:position]
- else
- raise ArgumentError, "Invalid option for :position"
- end
+ when :left
+ margin_box.absolute_left
+ when :center
+ margin_box.absolute_left + margin_box.width / 2.0 - width / 2.0
+ when :right
+ margin_box.absolute_right - width
+ when Numeric
+ margin_box.absolute_left + options[:position]
+ else
+ fail ArgumentError, "Invalid option for :position"
+ end
# we need to bust out of whatever nested bounding boxes we're in.
canvas do
bounding_box([left_boundary,
margin_box.absolute_top], :width => width) do