W3C home > Mailing lists > Public > www-style@w3.org > April 2016

Re: [css-round-display] Add 'auto' to 'polar-anchor' and make it as initial value

From: Brad Kemper <brad.kemper@gmail.com>
Date: Thu, 21 Apr 2016 14:28:05 -0700
Cc: www-style list <www-style@w3.org>
Message-Id: <AC2E8660-1697-48DD-9F8C-23E9CE9C90AC@gmail.com>
To: Jihye Hong <jh.hong@lge.com>



Brad Kemper
On Apr 21, 2016, at 1:56 AM, Jihye Hong <jh.hong@lge.com> wrote:

>> You aren't really changing the coordinate system of either the element or
>> its containing block. '50% 50%' still refers to halfway across and down
>> from the zero point on the left top. And all other properties continue to
>> use Cartesian coordinates too. 'Polar-distance' and 'polar-angle' are
>> simply an additional transformation from where 'polar-anchor' puts it.
>> 
>> Polar-anchor:0 0 would put the element's center into the top left corner
>> of the containing block.
> When you specify 'polar-distance' or 'polar-angle' on the element, it means
> that the element will be positioned in polar coordinates.
> By default, the element's center is put into the center of the containing
> block

I think it would be much more intuitive to have 'polar-origin' be the property that puts it in the center of the containing block, since it's value of 50% 50% is what would put it in the center anyway. Then 'auto' can just work the same as it does in top/right/bottom/left (does not center). 

Thus we can say that 'polar-origin' does nothing for 'position:relative', while 'polar-angle' and 'polar-distance' works the same for all non-static positions. Non-auto 'polar-angle' or 'polar-distance' would not cause any extra centering to automatically occur; 'polar-origin' would handle it all by itself. 

> for polar positioning.

Those three words are unnecessary. For all non-static positioning (relative, absolute, or fixed), 'polar-angle' and 'polar-distance' would move the element the specified distance along the specified angle. If 'polar-origin' had a non-auto value, it would first put the center of the element at the specified (Cartesian) point in the containing block. That is simple and easy to understand, without asking anyone to reorient themselves to a different coordinate system, or to wonder what a different coordinate system might mean to other properties that use x and y (it means nothing: even 'polar-origin' is still measured from the top left corner in the current spec). 

> 'polar-anchor:0 0' would put the element's upper left corner into the center
> of the containing block when you give a value as '50% 50%' for
> 'polar-origin'.

Yes that makes some sense. A different way to do it would be to have 'polar-anchor:0 0' be the center of the element. Positive amounts would move the anchor towards the right/bottom, while negative amounts would move the anchor towards the left/top. This would have the same general effect as polar-anchor does already, except it would not need an 'auto' value. 'polar-anchor:0 0' would just always mean "don't move the origin at all" (from its default of "center of the element", which is where it starts when 'polar-origin' is non-auto). 'polar-anchor:10px -50%' would mean "move the origin 10px to the right, and 50% of its height towards the top."

Of course, this then has EXACTLY THE SAME effect as 'transform: translate(tx,ty)', where tx and ty are the polar-anchor values specified, but multiplied by -1. 
Received on Thursday, 21 April 2016 21:28:35 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:38 UTC