Conversation
|
Nice to see this! In Servo we also reuse WebRender's |
|
Added #547 to workaround the CI failure that comes from upstream.
I really want to keep euclid super-duper API-stable because of how much churn breaking changes create downstream. I feel like ScaleOffsetTransform2D is pretty safe to put in the API, but it's less clear for FastTransform in my opinion (there is a fair amount of nuance about how it could be implemented). Maybe we could add a separate "euclid_extras" crate where we put code that we would like to share or experiment with, but without the stability guarantees of the main crate? |
|
Exposing a new crate seems fine, or perhaps we can just add this type to the |
This PR moves the corresponding type from WebRender and adapts it to euclid's convention.
Scale-offset transformations are common enough for a browser engine or UI toolkit that it is worth having a special case for. In addition to requiring fewer operations than
Transform2D,ScaleOffset2Dfits in only 4 scalars, and is guaranteed to be able to transform boxes and rectangles exactly (Transform2Dcan only produce conservative outer boxes).