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

Documented feature svg.drawLine() missing from v4.0.0 #975

Closed
Chuuone opened this issue Apr 7, 2025 · 1 comment
Closed

Documented feature svg.drawLine() missing from v4.0.0 #975

Chuuone opened this issue Apr 7, 2025 · 1 comment

Comments

@Chuuone
Copy link

Chuuone commented Apr 7, 2025

Describe the bug
While attempting to migrate to v4.0.0 i encountered issue while refactoring my animations based on the old dash offset.

Documentation here: Svg

Describes being able to utilise

strokeDashoffset: svg.drawLine()
to replicate the behaviour from v3.2.* that would look something like this:
strokeDashoffset: [anime.setDashoffset, 0]

The svg namespace however, does not export such a method.

To Reproduce

  1. Check the svg.js file
  2. Look for drawLine()

Expected behavior
Documentation should state no support for this currently or adjust to correct approach.

Screenshots

Image

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@Chuuone Chuuone changed the title Documented feature missing from v4.0.0 Documented feature svg.drawLine() missing from v4.0.0 Apr 7, 2025
@juliangarnier
Copy link
Owner

Check out the migration guide: https://github.com/juliangarnier/anime/wiki/Migrating-from-v3-to-v4#animesetdashoffset-line-drawing

- anime({
-   targets: 'path',
-   strokeDashoffset: [anime.setDashoffset, 0],
- });
+ animate(createMotionPath('path'), {
+   draw: '0 1',
+ });

Hop this helps!
Feel free to reopen if it doesn't answer your question.

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