PeachDrawing.Core

PeachDrawing.Core.Matrix3x2Extensions

Matrix3x2Extensions.RebaseOrigin(this Matrix3x2, double, double) Method

Reinterprets this matrix - built treating the box’s own top-left corner as local (0, 0) - as pivoting around the given absolute (page-space) point instead. Equivalent to translate(-px,-py) * this * translate(px,py): the linear part (M11/M12/M21/M22) is unchanged, only the offset shifts so that (px, py) becomes a fixed point wherever it sits on the page. Needed because painting draws in absolute page coordinates, and a box’s page position (its Bounds plus the current page’s scroll offset) can vary across repeated paint passes (e.g. pagination), while the underlying matrix itself is cached and computed once.

public static System.Numerics.Matrix3x2 RebaseOrigin(this System.Numerics.Matrix3x2 matrix, double px, double py);

Parameters

matrix System.Numerics.Matrix3x2

px System.Double

py System.Double

Returns

System.Numerics.Matrix3x2