Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save pixelhijack/9684493 to your computer and use it in GitHub Desktop.
Save pixelhijack/9684493 to your computer and use it in GitHub Desktop.
/*
Raphael.js: find the center of element
*/
// element = paper.rect(......);
var cX = element.getBBox().x + element.getBBox().width/2,
cY = element.getBBox().y + element.getBBox().height/2;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment