Re: ISSUE-2208 (rotate-center-point): Consider allowing rotations to be relative to their bounding box center [SVG Core 2.0]

Hi, Cam-

Cameron McCormack wrote (on 1/29/09 7:33 PM):
> ISSUE-2208:
>> It is very common to rotate an object about its center point. This
>> requires knowing the center point, however, and in some cases this
>> can't be known without scripting. It would be handy to be able to
>> specify that a rotation happens about the center point, e.g.:
>>
>>   <svg ...>
>>     <text x='50' y='50' transform='rotate(-90, center)'/>
>>   </svg>

Amen.


> “center” here would mean bounding box center.  I could imagine other
> keywords being introduced to mean other, particular points on the
> object.  These keywords would be the same as those that we might define
> for the Layout module.

In addition to keywords regarding the bbox (top-left, mid-right), we
might allow definition of points along the stroke itself, such as
distance along the length, or even points inside the shape, though that
might be hard to do in any meaningful way.

An alternative would be allowing a reference point for the rotation:

<svg xmlns="http://www.w3.org/2000/svg">
    <path d="M89,107 L70,89 51,107 53,81 27,78 49,63 35,41 60,49
             69,24 79,48 103,41 90,63 112,77 86,81 89,107Z"
          fill="orange" stroke="red" transform="rotate(45, #point_1)"/>
    <point id="point_1" cx="90" cy="72" />
</svg>


Or something like that.


> “centroid” could be another one, but I’m not sure how useful that would
> be.

Yeah, that occurred to me too... but I'm also not sure of its usefulness.

Regards-
-Doug Schepers
W3C Team Contact, SVG and WebApps WGs

Received on Friday, 30 January 2009 02:04:36 UTC