Avalonia.Controls.PanAndZoom.MatrixHelper.ScaleAtPrepend C# (CSharp) Method

ScaleAtPrepend() public static method

Prepends a scale around the center of provided matrix.
public static ScaleAtPrepend ( Avalonia.Matrix matrix, double scaleX, double scaleY, double centerX, double centerY ) : Avalonia.Matrix
matrix Avalonia.Matrix The matrix to prepend scale.
scaleX double Scaling factor that is applied along the x-axis.
scaleY double Scaling factor that is applied along the y-axis.
centerX double The center X-coordinate of the scaling.
centerY double The center Y-coordinate of the scaling.
return Avalonia.Matrix
        public static Matrix ScaleAtPrepend(Matrix matrix, double scaleX, double scaleY, double centerX, double centerY)
        {
            return ScaleAt(scaleX, scaleY, centerX, centerY) * matrix;
        }

Usage Example

Exemplo n.º 1
0
        public void ZoomTo(double zoom, Point point)
        {
            _matrix = MatrixHelper.ScaleAtPrepend(_matrix, zoom, zoom, point.X, point.Y);

            Invalidate();
        }