Reputation: 38842
If I have a circle object
var c = paper.circle(...)
I would like to get this circle's center x, y position, how to get?
Upvotes: 2
Views: 6827
Reputation:
Do something like:
var c = paper.circle(...);
var centerX = c.attr('x') + c.attr('width') / 2;
var centerY = c.attr('y') + c.attr('height') / 2;
Upvotes: 1
Reputation: 93674
You can get the SVG attributes of cx
and cy
with:
c.attr('cx');
Upvotes: 11