Jump to content
Search Community

DrawSVG Stoke Alignment

WA007 test
Moderator Tag

Go to solution Solved by WA007,

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hi all-

 

I've been wondering if stroke:alignment is support in DrawSVG?

 

Has anyone come across anything that could be a workaround or is this supported? It could help me out with a simple text and complex path animations I'm trying to accomplish. This is mainly for things like text where I would want to have the stroke be inner so the font doesn't look so think even at a 1px stroke.

 

I have included a pen for reference. Any help would be much appreciated! 

See the Pen jqQZgx by wa007 (@wa007) on CodePen

Link to comment
Share on other sites

Hi WA007 :)

 

Welcome to the forums.

 

I like that animation - very nice. To my knowledge, this isn't a limitation of the drawSVG plugin, but rather SVG itself. Right now, we get center aligned strokes on everything. Support for inner and outer alignment is coming, but there are some things that need to be figured out first. Here's a bit of info about that:

 

https://www.w3.org/TR/svg-strokes/#SpecifyingStrokeAlignment

 

As far as a workaround now, maybe two copies of the path with the stroked version slightly smaller than the filled version so it appears that the stroke is aligned inner? Others may jump in with additional ideas, but that's the first thing that comes to mind for me.

 

Happy tweening and welcome aboard.

:) 

  • Like 2
Link to comment
Share on other sites

  • Solution

Hi PointC

 

Thanks for the quick reply, same thing I found from the research I did :(

 

Your workaround is the direction I was leaning towards and would work for certain scenarios. 

 

Thanks again!

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...