Skip to content

[motion-1] Direction of offset-rotate at segment boundaries #209

Closed

Description

@karip

The direction at segment boundaries used by offset-rotate came up during discussion about the SVG pathAngleAtLength() function. I’m opening this issue to get more feedback.

The direction at segment boundaries can be either the direction of the previous path segment or the direction of the next path segment.

Animation software seems to use either of them. After Effects seems to use the direction of the previous path segment. Apple Motion seems to use the direction of the next path segment.

CSS Motion Path defines the direction to be the direction of the previous path segment and Google Chrome has implemented it that way.

Should it be changed to be the direction of the next path segment?

SVG 2 Path Directionality defines the direction at the start of a path segment and the direction at the end of a path segment. CSS Motion Path could be changed to reference either of them to get a more precise definition which covers also zero-length subpaths.

Activity

  1. ewilligers commented on Aug 7, 2017

    @ewilligers
    Contributor

    SVG markers, animateMotion, CSS Motion Path and 'b' path commands should all use consistent direction.

    Ideally, the SVG spec would normatively describe direction, and the motion path spec would link.

    An SVG pathAngleAtLength() function would be excellent. Other specs could link to that instead of ‘path’ element implementation notes (the most precise definition of direction in SVG 1.1). Web platform tests should cover 0 length paths like 'm 100 100 b -90'.

    (I'm responsible for the Blink motion path implementation. I simply reused the internal function PointAndNormalAtLength used by animateMotion. Any bugs in that method should not be baked into the motion path spec.)

  2. heycam commented on Sep 15, 2019

    @heycam
    Contributor

    The SVG 2 Path directionality section says:

    Otherwise, if the given distance along the path occurs at a path segment boundary, then the direction of the path is the direction at the start of the segment at the given distance, considering each segment to be endpoint exclusive.

    So I think we should follow that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions