I have a fluid element on the page which has width: 100% and aspec-ratio: 16/9 css properties applied. When exporting the element using toPNG() if i set a width of 2000 the image results in almost empty space.
The target element still the same size rendered on the page, so width is not applied to the element itself but just to the image canvas. The image below show a PNG generated with width set to 2000, but the real content is the same size as it was when rendered on the page, instead of filling the whole canvas.
Use case: description, code
I have a fluid element on the page which has
width: 100%
andaspec-ratio: 16/9
css properties applied. When exporting the element usingtoPNG()
if i set a width of2000
the image results in almost empty space.The target element still the same size rendered on the page, so width is not applied to the element itself but just to the image canvas. The image below show a PNG generated with
width
set to2000
, but the real content is the same size as it was when rendered on the page, instead of filling the whole canvas.My options
Expected behavior
The target element should be the size specified inside options
Actual behavior (stack traces, console logs etc)
Target element should be the size specified when rendered as image.
Library version
Browsers