How do you guys feel about Famous 0.3 having only origin
vs Famous 0.5 (Engine) both origin
and mountPoint
?
In Famous 0.3 origin
and mountPoint
were the same thing, but in 0.5 they are separated. Does the having a separate mountPoint
give actual added value and let us achieve things we can achieve with origin/mountPoint combined?
Maybe I’ll answer my own question as I type this.
Without a mountPoint
(it being the same as origin
, as in Famous 0.3) then the end user would have to apply extra transforms sometimes to achieve the same. For example, suppose we’re in Famous 0.3 and we want to align something perfectly in the middle of a parent container, then we’d set align and origin to [0.5,0.5]
. Rotating and scaling will be applied to the middle of the item as well.
Now, suppose we want to align the top0left corner of an item in the center of it’s parent: then we can set align to [0.5,0.5]
and origin (Famous 0.3 origin) to [0,0]
. This will produce the alignment we want, but if we rotate the item or scale it, the rotation and scaling will happen about the top-left corner of the item.
What if we want to align the top-left corner of an item in the center of it’s parent, but we want rotation and scale to happen around the center of the item?
In with famous-0.3-style origin, we’d set both align and origin to [0.5,0.5]
, then we’d have to translate the element by half it’s width and height downward and to the right, which is fine, and easy to do, but perhaps more effort than is ideal for end use-cases.
Enter mountPoint! We can do the same as the last paragraph by simply setting align and origin to [0.5,0.5]
and moutPoint to [0,0]
(top left).
I’ve answered my own question. But, I’ll post it anyways, for reference, in case any one was wondering. Look at that, [SOLVED] before even posting, but still would like opinions if any!