-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
measure() #295
Comments
I think it's an issue of semantics for 'transform', which does imply that one is actually changing something. It's normal with the Nevertheless
which has been fine for students... but true, there aren't so many getters that return an object. |
Yes, exactly, it is a semantic issue. That's why I would like to add The bounds thing could simply be solved by offering the possibility to do Also, the |
@fabianmoronzirfas @b-g |
|
I would vote for keeping things clean and therefore having
This way we have |
Hi all! Many thanks @trych for the ping! Just read through the entire issue with "fresh eyes" ... I agree that using Basically I fully agree with:
|
@ffd8 Would that be okay for you as well? |
Awww.. I still dig the I also don't quite get the reasoning to tweak some functions to only be getters and others setters.. nice that most of the functions set if 2+ value[s] is given, otherwise acts as getter. Not too hard to teach to beginners. More unique words = more vocab for them to learn. Nevertheless, I'm open to the change and curious, what would the proposed replacing of |
I think it would just work like this: measure(myPageItem, "bounds"); And there you get back your bounds object as you were used to, which should make for an easy transition for those bounds lovers. 😉 Will assign myself to this then, if that's okay. |
Great! :) What about having |
Yes, that's a good idea. It will be a slower than doing |
After I have been using the new
transform()
function for a while now, I came to the conclusion that it feels quite awkward to use it for measuring something. Example:Although we decided initially to create transform as a setter and getter, the term does not really work for a getter. If I am just using it to get the rotation of an item, I am not transforming anything, hence the term feels wrong. My suggestions therefore is to introduce a function named
measure()
that allows me to do exactly that: measure transform properties of an object.It could simply be a wrapper of
transform()
that allows getting values, but I think, if we have thismeasure()
function anyways, we could make it even more useful. I think it couldreplace
bounds()
and therefore also measure typographic features (in case my item is text).unlike
bounds()
it could measure specific properties only. Example:could measure the baseline of each word only and would therefor be much faster than
bounds()
measuring and calculating all the properties.it could be used to measure page and spread bounds as well
I think the syntax
measure(myItem, "property");
is a bit easier and more basil-like thanbounds(myWord).property
. Since we can make breaking changes before 2.0, now would be the best time to make a change like this.@basiljs What do you guys think?
The text was updated successfully, but these errors were encountered: