Closed danfishgold closed 6 years ago
Thanks for the pull request @danfishgold, your code looks great! I think a tuple is the best way to go here.
Two questions:
examples
directory? I use it for regression testing as visual debugging is bad to automate.scaleX
and scaleY
are less confusing than broaden
and lengthen
? I'm leaning towards your side, but need some more confidence before fixing the api. Same holds for skewX
and skewY
compared to slant
and tilt
which seem nice, but can be confusing to remember which is in the x and which in the y direction.skewX
and skewY
are the names used in svg (and css) transforms. People who are familiar with this will know what these functions mean, and beginners will have an easier time Googling for help.
Also, as a non-native English speaker, I don't know the difference between skew, tilt, and slant so I prefer to explicitly state the axis.
I don't have as strong a case for scale
, but if there's skewX
and skewY
, I think there should be scaleX
and scaleY
. If you still prefer nicer names I don't think lengthen
is a good fit because there are cases where it might be ambiguous: lengthening a rectangle (or a bus, or a snake) means increasing its longer side, which isn't necessarily along the Y axis.
You totally convinced me! Especially that function names will be easily recognised is a big plus.
Thanks for changing the docs, can you make a small example? Then I'll merge your request.
I'm a little late to the party, but I think it's worth pointing out that words like lengthen
and broaden
tend to suggest an increase in size (i.e. a scale factor of greater than 1), which is not desirable here. scale
and skew
also have the bonus of being familiar to those with backgrounds in linear algebra.
Even more reasons to use scaleX/Y
and skewX/Y
instead of fancy names!
Thanks for your opinion @Kwarrtz.
I can't think of a basic example for scaleX
and scaleY
because for simple stuff you can use rectangles instead of squares and ellipses instead of circles 😅
I'll think of something :wink:
I saw the TODO where you wanted to give them cooler names, but I think these names are less confusing and more in line with Elm GraphicSVG and Elm Graphics.
I implemented this with a tuple
scale : (Float, Float)
, but it could have been done with a record. I'm not sure which is better.