Skip to content

Instantly share code, notes, and snippets.

@kwerle
Created March 10, 2014 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kwerle/9474359 to your computer and use it in GitHub Desktop.
Save kwerle/9474359 to your computer and use it in GitHub Desktop.
rectPosition: (rect) ->
rx = + rect.getAttribute('x')
ry = + rect.getAttribute('y')
rctm = rect.getCTM()
xn = rctm.e + rx * rctm.a
yn = rctm.f + ry * rctm.d
r =
x: xn
y: yn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment