Closed trych closed 6 years ago
I vote for b.referencePoint() - since that's what inDesign refers to it as (when holding mouse over that GUI element).
Haha, sorry I even mentioned it being part of b.transform()... We should avoid adding 4th params to the b.transform() – since that keeps it from being a very straight forward adaptation of items as found in the jongware API docs of properties safely be passed into it (like how b.typo works) – one should actively set the referencePoint, then do their transformations. I think most will set the referencePoint once and leave it alone.
Yes, that's a good point, else you'll have to add the 4th parameter repeatedly if you want to rotate all your rectangles around the lower right corner.
Edit: ~Also agree, that it should be named b.referencePoint()
as that's the InDesign term and we have no matching functions in Processing and p5.js that we need to imitate~.
Edit 2: Ha, I stand corrected, the actual Enumerator is called AnchorPoint
, while the property of the layout window is called transformReferencePoint
(see the reference). In this case, I would prefer b.anchorPoint()
as it is shorter and I guess the more familiar term for most students (even though the label is different). Opinions?
The next question is, do we introduce 9 new constants (b.TOP_LEFT
, b.TOP_CENTER
, etc.) or do we use the InDesign enumerators (AnchorPoint.TOP_LEFT_ANCHOR
, AnchorPoint.TOP_CENTER_ANCHOR
etc.) which are super-long?
And what is the "Array of 2 units" option that is mentioned in reference? If we could describe the point with 2 units, that might be even better.
I vote for enumerators, and include them all in documentation of the function. This is the case with functions like textAlign()
. Ugly, but unique for inDesign and maybe helps bridge that gap as one incorporates additional non-basiljs code from the API.
Re: 2 units, seems to be a special return value, so we can ignore it. Perhaps it's a row/col array for the 3x3 options..?
enums using AnchorPoint.____ makes a good argument for b.anchorPoints()
... but a search for 'indesign anchor point', turns up the anchor point tool and whole other world (was curious if forums etc used that word for what we're talking about). Searching for 'indesign reference point' = many articles on exactly this.
Ok, so we decide on b.referencePoint(AnchorPoint.TOP_LEFT_ANCHOR)
?
I must say the "referencePoint … AnchorPoint" does read a bit weird though…
True. Sounds strange
I would vote to just go for b.anchorPoint()
. If we just explain in the reference what it is, then people should not get it confused with something else.
I mean we have the same thing with ellipse vs. oval and textSize vs. pointSize, yet it works. So for make a less confusing method syntax, I would go for anchorPoint.
Adobe did a slightly weird one here.. in Illustrator and InDesign it's called 'reference point'.. in AfterEffects it's maybe 'anchor point'? My vote is for using it the InDesign way, so people can easily find it when searching the official names (we can also throw 'anchor' into the description for finding it), then if need be, creating the 9 constants to avoid the clash of words. ie.b.referencePoint(b.TOP_LEFT_ANCHOR);
But slowly I get used to their logic.. the referencePoint is what it's going to revolve around.. the anchorPoint is an actual point to be referenced...
If we create 9 constants, then we should do just b.referencePoint(b.TOP_LEFT)
, then we avoid the anchor confusion altogether. What are the opinions on that? I would be fine with it.
Fine with b.referencePoint(b.TOP_LEFT)
:)
Guys! Amazing news!
We just need to create 8 new constants, as b.CENTER
exists already. So efficient! ;)
This has been implemented in #263. Closing.
As @ffd8 mentioned in #222, it would be great to be able to move the anchor point.
Two possibly options (quoting ffd8):
b.referencePoint()
orb.anchorPoint()
which seems to not be specific to any single item, but general preference for future transformations..b.transform()
.. but it's more tricky/specific than the other transform properties, so should likely get it's own function.Personally, I am not sure, which option is preferable? What do the others think? @b-g @fabianmoronzirfas ?
b.transform syntax will be
b.transform(myItem, "rotation", 45)
, so if anchor point would be part of it, it would beb.transform(myItem, "rotation", 45, b.BOTTOM_RIGHT)
instead, the last argument being optional of course.