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

Rendering issue #742

Closed
Almis90 opened this issue Aug 2, 2022 · 12 comments
Closed

Rendering issue #742

Almis90 opened this issue Aug 2, 2022 · 12 comments

Comments

@Almis90
Copy link

Almis90 commented Aug 2, 2022

SVG:

<svg xmlns="http://www.w3.org/2000/svg" width="45" height="45"><g fill="none" fill-rule="evenodd" stroke="#000" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M22 10c10.5 1 16.5 8 16 29H15c0-9 10-6.5 8-21" fill="#000"/><path d="M24 18c.38 2.91-5.55 7.37-8 9-3 2-2.82 4.34-5 4-1.042-.94 1.41-3.04 0-3-1 0 .19 1.23-1 2-1 0-4.003 1-4-4 0-2 6-12 6-12s1.89-1.9 2-3.5c-.73-.994-.5-2-.5-3 1-1 3 2.5 3 2.5h2s.78-1.992 2.5-3c1 0 1 3 1 3" fill="#000"/><path d="M9.5 25.5a.5.5 0 1 1-1 0 .5.5 0 1 1 1 0zm5.433-9.75a.5 1.5 30 1 1-.866-.5.5 1.5 30 1 1 .866.5z" fill="#ececec" stroke="#ececec"/><path d="M24.55 10.4l-.45 1.45.5.15c3.15 1 5.65 2.49 7.9 6.75S35.75 29.06 35.25 39l-.05.5h2.25l.05-.5c.5-10.06-.88-16.85-3.25-21.34-2.37-4.49-5.79-6.64-9.19-7.16l-.51-.1z" fill="#ececec" stroke="none"/></g></svg>

Expected result:
image

Actual result:
image

@dnfield
Copy link
Owner

dnfield commented Aug 2, 2022

Which platform?

@Almis90
Copy link
Author

Almis90 commented Aug 2, 2022

Tried on web, macos and iOS and it has same result.

@dnfield
Copy link
Owner

dnfield commented Aug 3, 2022

This is a bug in the path parsing library. Specifically, it's not handling concatenated arc commands well right now. This is a smaller reproduction

<svg xmlns="http://www.w3.org/2000/svg" width="45" height="45">
  <g fill="none" fill-rule="evenodd" stroke="#000" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" transform="scale(4)">
    <path d="M5.5 5.5a.5 1.5 30 1 1-.866-.5.5 1.5 30 1 1 .866.5z" fill="black" stroke="black" />
  </g>
</svg>

@dnfield
Copy link
Owner

dnfield commented Aug 3, 2022

Ahh it's not even just back to back arcs, the decomposition math is wrong for the arcs in here.

@dnfield
Copy link
Owner

dnfield commented Aug 3, 2022

path_parsing is failing to convert degrees to radians when doing a matrix rotation operation. Ugh. How did this ever work.

@dnfield
Copy link
Owner

dnfield commented Aug 3, 2022

I have a fix for this and I'm very curious how many golden image tests it breaks in google.

@Almis90
Copy link
Author

Almis90 commented Aug 4, 2022

I have a fix for this and I'm very curious how many golden image tests it breaks in google.

Thank you for your quick resolution. I started learning flutter 2 days ago, not familiar with the term golden image tests in Google, does it mean that there might be an issue on web?

@Almis90 Almis90 closed this as completed Aug 4, 2022
@Almis90
Copy link
Author

Almis90 commented Aug 4, 2022

Closed by mistake, just wanted to leave comment

@Almis90 Almis90 reopened this Aug 4, 2022
@dnfield
Copy link
Owner

dnfield commented Aug 4, 2022

No, sorry - this package is used internally at Google by a large number of golden image tests. Fixing this could potentially change them if people accepted this mistake. Luckily, it looks like not many of the tests internal to Google use this feature :)

I'll be publishing a fix for this soon.

@dnfield
Copy link
Owner

dnfield commented Aug 4, 2022

(In other words - this is a real bug, but it's been around since I created this package so some people might be depending on the incorrect behavior, which is sad)

@Almis90
Copy link
Author

Almis90 commented Aug 4, 2022

Just tested, works great!

@dnfield
Copy link
Owner

dnfield commented Aug 8, 2022

For future me:the reason this wasn't caught sooner is because most usages that were ever seriously tested were circular (or roughly circular) arc commands, where the rotation didn't make a difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants