mirror of
https://github.com/foliojs/pdfkit.git
synced 2025-12-08 20:15:54 +00:00
Merge pull request #78 from wabbit/master
Added image alignment to the image fit option
This commit is contained in:
commit
5ef0bd8ac3
@ -49,6 +49,12 @@ module.exports =
|
||||
else
|
||||
h = bh
|
||||
w = bh * ip
|
||||
|
||||
if options.align
|
||||
if 'center' == options.align
|
||||
x = x + bw / 2 - w / 2
|
||||
else if 'right' == options.align
|
||||
x = x + bw - w
|
||||
|
||||
# Set the current y position to below the image if it is in the document flow
|
||||
@y += h if @y is y
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user