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

SvgDrawingAnimation ignores fill-rule #6

Open
Zabadam opened this issue Jan 13, 2024 · 0 comments
Open

SvgDrawingAnimation ignores fill-rule #6

Zabadam opened this issue Jan 13, 2024 · 0 comments

Comments

@Zabadam
Copy link

Zabadam commented Jan 13, 2024

Right at the beginning of README is "[f]or now, it only renders paths," but I am unsure if it is meant that fill-rule would not be obeyed. Surely my SVG here is comprised of paths and not polygons:

<!--
Just to be sure path directions are irrelevant: fill-rule="evenodd".
To be clear, issue persists with (correct path directions) and "nonzero".
-->
<svg
  xmlns="http://www.w3.org/2000/svg"
  fill-rule="evenodd"
  clip-rule="evenodd"
  viewBox="0 0 1200 1200"
  fill="red"
  stroke="#000"
  stroke-width="35">
    <path d="
      M690 89a517 517 0 0 0-361 30A461 461 0 0 0 73 554c13 371 316 536 580 529s459-255 436-529A519 519 0 0 0 690 89Z
      M508 203c9-1 19 0 28 2 182 47 328 646 142 686-165 36-221-138-262-319-42-180-26-362 92-369Z
    "/>
</svg>
Expected intersection rendering

(bug_evenodd) svg_drawing_animation

  runApp(MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        body: Center(
          child: SvgDrawingAnimation(
            SvgProvider.string(r'<svg xmlns="http://www.w3.org/2000/svg" fill="red" stroke="#000" stroke-width="35" viewBox="0 0 1200 1200"><path d="M690 89a517 517 0 0 0-361 30A461 461 0 0 0 73 554c13 371 316 536 580 529s459-255 436-529A519 519 0 0 0 690 89ZM508 203c9-1 19 0 28 2 182 47 328 646 142 686-165 36-221-138-262-319-42-180-26-362 92-369Z"/></svg>'),
            duration: const Duration(milliseconds: 4000),
            curve: Curves.decelerate,
          ),
        ),
      )));
SvgDrawingAnimation rendering

(bug_evenodd) svg_drawing_animation

Just before the outer stroke begins drawing, there is a slight pause.
This could be the inner cavity being "drawn"—just not correctly subtracting from the existing shape.

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

1 participant