Skip to content

Commit

Permalink
Add options position and vposition
Browse files Browse the repository at this point in the history
Possible values:
```rb
position: :center
position: :right
vposition: :center
vposition: :bottom
```
  • Loading branch information
mirelon authored Dec 13, 2023
1 parent 8ceaa10 commit 0596105
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/prawn/images.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,18 @@ def embed_image(pdf_obj, info, options)

if options[:at]
x, y = map_to_absolute(options[:at])
case options[:position]
when :center
x-=w/2
when :right
x-=w
end
case options[:vposition]
when :center
y+=h/2
when :bottom
y+=h
end
else
x, y = image_position(w, h, options)
move_text_position h
Expand Down

0 comments on commit 0596105

Please sign in to comment.