summaryrefslogtreecommitdiff
path: root/spec/page_spec.rb
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2020-07-07 23:54:56 -0600
committerDan Allen <dan.j.allen@gmail.com>2020-07-08 02:08:51 -0600
commit468353aaf85a7fe2542abe355affca7562866574 (patch)
tree29048289172beb61b0f3cb4223a77fbadc87d991 /spec/page_spec.rb
parentd85665707f5681487669541890a7b48a78f60f05 (diff)
assert that background image is scaled down if intrinsic height is greater than height of page
Diffstat (limited to 'spec/page_spec.rb')
-rw-r--r--spec/page_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/page_spec.rb b/spec/page_spec.rb
index 5fbdba97..32aade8d 100644
--- a/spec/page_spec.rb
+++ b/spec/page_spec.rb
@@ -782,6 +782,15 @@ describe 'Asciidoctor::PDF::Converter - Page' do
(expect to_file).to visually_match 'page-background-image-svg-scale-down.pdf'
end
+ it 'should scale down background SVG to fit boundaries of page if intrinsic height is greater than page height', visual: true do
+ to_file = to_pdf_file <<~'EOS', 'page-background-image-svg-fit-scale-down-height.pdf'
+ :pdf-page-size: A5
+ :page-background-image: image:tall.svg[pdfwidth=200,fit=scale-down]
+ EOS
+
+ (expect to_file).to visually_match 'page-background-image-svg-scale-down-height.pdf'
+ end
+
it 'should not scale background SVG with explicit width to fit boundaries of page if fit is scale-down and image fits', visual: true do
to_file = to_pdf_file <<~'EOS', 'page-background-image-svg-prescaled.pdf'
= Document Title