-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
blPathFitTo does not honor fitFlags #92
Comments
I think this could be a possible duplicate of #44 ? Maybe time to finally specify what fitFlags should do? |
My suggestions: how to scale the bbox, 4 choices, (2 bits)
Default should be BESTFIT but if we don't want to break the blPathFitTo () API, it must be STRETCH how to align the bbbox, 9 choiches, (4 bits)
Moreover I'd like a In total 8 bits |
Do we want any parity with preserveAspectRatio from SVG (https://www.w3.org/TR/SVG11/coords.html#PreserveAspectRatioAttribute) ? Initially I thought about implementing exactly this, but Blend2D can support a bit more |
I personally think those SVG setups are unnecessarily complex and use unintuitive terms. What are the extended features you are thinking about ? |
I thought about defining fitFlags that would work for two cases:
What comes on my mind is whether to crop the input or not in case that it would overflow the target rectangle or not. Not sure about anything else - I'm okay with invert as these all just manipulate the transformation matrix in the end. I mean the goal is of course to support things that SVG supports - if the API is a bit different but compatible it's okay. |
I hadn't blitImage in my mind, time to refresh my mind ... When you do blitmage() to a point P, the src image (or a subimage) is not stretched, nor cropped, but it scaled/rotated using the currently-set context coordsys. In this case it could be useful to add a way to define which point of the src-subimage to align with P. Of course these are not core-features, they could be easily implemented "over" the current API, but I think they will be very useful in many practice cases. My only wish is that the default flags values should be simple and intuitive and that they won't bloat the API. |
I guess fitFlags should be for maintaining xy proportions, but currently it's not used.
I kindly suggest a bit-flag for flipping the y coords too.
The text was updated successfully, but these errors were encountered: