Proposals/AnimateMotion DOM API

From SVG
< Proposals
Revision as of 23:43, 25 October 2011 by Edahlstr (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This proposal adds a way to query the current position and rotation of a shape that is animated with animateMotion. It's related to ISSUE-2204 - Improve DOM Interfaces for SMIL Values.

partial interface SVGAnimateMotionElement {

  // The position on the path at the current time, the returned object is a snapshot and is not live.
  SVGPoint position;

  // The rotation angle (in degrees) at the current time, taking into account the 'rotate' attribute.
  readonly float angle; 
};

Issues

  • Could perhaps return an SVGAngle for the angle instead, but then the whole object should be read-only, and most of the methods there are only useful on mutable objects.
  • Could add as a convinience a transform property too, to get the combined translate/rotate transform.