W3C home > Mailing lists > Public > www-svg@w3.org > January 2010

Re: DOM APIs - Get & Set Element Center Point

From: Doug Schepers <schepers@w3.org>
Date: Sat, 23 Jan 2010 19:28:13 -0500
Message-ID: <4B5B941D.8080007@w3.org>
To: Francis Hemsher <fhemsher@gmail.com>
CC: www-svg@w3.org
Hi, Francis-

Francis Hemsher wrote (on 1/23/10 8:11 AM):
> A developer who dynamically positions the location of elements is
> continually computing the center point of the element: Generally via
> the bounding box location and size.

Yes, methods to get the centerpoint and centroid of a shape (or 
collection of shapes) would be very useful.

A related reason I often use getBBox to find the centerpoint of a shape 
is when positioning text in that shape.  One way to address that 
specific case is to have better layout markup, but doesn't eliminate the 
need for shortcut methods like getCenter and getCentroid (as I would 
prefer to call them).

-Doug Schepers
W3C Team Contact, SVG and WebApps WGs
Received on Sunday, 24 January 2010 00:28:19 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:19 UTC