Transforms content bounds to viewport coordinates, accounting for layout offset.
public static Rect TransformContentToViewport(Rect elementBounds, Matrix matrix)
The element bounds (includes Position where Avalonia laid out the element).
The transform matrix.
When a child element has a differnt size than the ZoomBorder, Avalonia's layout system positions it (e.g., centered) resulting in a non-zero Position in elementBounds. This layout offset is in viewport coordinates and should not be scaled by the transform matrix. This method correctly separates the two coordinate systems.