Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix svg render error size. #4843

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Haoxiqiang
Copy link

Description

The SVG file renders the file's document width/height as the first choice.

Motivation and Context

In some files.

<svg width="33" height="53" viewBox="0 0 33 53" fill="none" xmlns="http://www.w3.org/2000/svg">
	<path d="M16.3576 0.666687L16.0095 1.85009V36.1896L16.3576 36.5371L32.2976 27.115L16.3576 0.666687Z" fill="#343434"/>
	<path d="M16.3578 0.666687L0.417816 27.115L16.3578 36.5372V19.8699V0.666687Z" fill="#8C8C8C"/>
	<path d="M16.3575 39.5552L16.1613 39.7944V52.0268L16.3575 52.6L32.307 30.1378L16.3575 39.5552Z" fill="#3C3C3B"/>
	<path d="M16.3578 52.5998V39.5551L0.417816 30.1377L16.3578 52.5998Z" fill="#8C8C8C"/>
	<path d="M16.3575 36.537L32.2973 27.1151L16.3575 19.8699V36.537Z" fill="#141414"/>
	<path d="M0.417816 27.1151L16.3576 36.537V19.8699L0.417816 27.1151Z" fill="#393939"/>
</svg>
On the pixel 3xl:
view box size. width: 33 height: 53 dpi:96
if we use renderToPicture()  Picture's size:width: 608 height: 977
if we use renderToPicture(DocumentWidth,DocumentHeight) Picture's size. width: 608 height: 1908
the view'size:width: 608 height: 1908

the picture's size should be determined based on the canvas size or document size.

@google-cla
Copy link

google-cla bot commented Jul 21, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@sjudd sjudd added the import-ready Indicates the PR is ready to be imported to Google. label Jul 24, 2022
@kanelbulle
Copy link
Collaborator

Thank you for the fix. Would you be willing to add a test case for this as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
import-ready Indicates the PR is ready to be imported to Google.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants