Skip to content

Commit

Permalink
Merge pull request nickhammond#4 from nu7hatch/master
Browse files Browse the repository at this point in the history
Fixed offsets for images
  • Loading branch information
moessimple committed Nov 16, 2012
2 parents cc7a85f + 2352449 commit f033855
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/prawn-fillform.rb
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,11 @@ def fill_form_with(data={})

if value
value = value.to_s
x_offset = options[:x_offset] || self.class.fillform_x_offset
y_offset = options[:y_offset] || self.class.fillform_y_offset

if field.type == :text
fill_color options[:font_color] || field.font_color
x_offset = options[:x_offset] || self.class.fillform_x_offset
y_offset = options[:y_offset] || self.class.fillform_y_offset

text_box value, :at => [field.x + x_offset, field.y + y_offset],
:align => options[:align] || field.align,
Expand All @@ -234,7 +235,7 @@ def fill_form_with(data={})
:style => options[:font_style] || field.font_style
elsif field.type == :button

bounding_box([field.x, field.y], :width => field.width, :height => field.height) do
bounding_box([field.x + x_offset, field.y + y_offset], :width => field.width, :height => field.height) do
if value =~ /http/
image open(value), :position => options[:position] || :center,
:vposition => options[:vposition] || :center,
Expand Down

0 comments on commit f033855

Please sign in to comment.