# Struct pango::Matrix [−][src]

pub struct Matrix(_);

## Expand description

A structure specifying a transformation between user-space coordinates and device coordinates. The transformation is given by

`<programlisting>`

x_device = x_user * matrix->xx + y_user * matrix->xy + matrix->x0;
y_device = x_user * matrix->yx + y_user * matrix->yy + matrix->y0;
`</programlisting>`

## Implementations

Changes the transformation represented by `self`

to be the
transformation given by first applying transformation
given by `new_matrix`

then applying the original transformation.

`new_matrix`

a `Matrix`

Returns the scale factor of a matrix on the height of the font.
That is, the scale factor in the direction perpendicular to the
vector that the X coordinate is mapped to. If the scale in the X
coordinate is needed as well, use `font_scale_factors()`

.

# Returns

the scale factor of `self`

on the height of the font,
or 1.0 if `self`

is `None`

.

Calculates the scale factor of a matrix on the width and height of the font.
That is, `xscale`

is the scale factor in the direction of the X coordinate,
and `yscale`

is the scale factor in the direction perpendicular to the
vector that the X coordinate is mapped to.

Note that output numbers will always be non-negative.

# Returns

`xscale`

output scale factor in the x direction, or `None`

`yscale`

output scale factor perpendicular to the x direction, or `None`

Changes the transformation represented by `self`

to be the
transformation given by first rotating by `degrees`

degrees
counter-clockwise then applying the original transformation.

`degrees`

degrees to rotate counter-clockwise

Transforms the distance vector (`dx`

,`dy`

) by `self`

. This is
similar to `transform_point()`

except that the translation
components of the transformation are ignored. The calculation of
the returned vector is as follows:

`<programlisting>`

dx2 = dx1 * xx + dy1 * xy;
dy2 = dx1 * yx + dy1 * yy;
`</programlisting>`

Affine transformations are position invariant, so the same vector
always transforms to the same vector. If (`x1`

,`y1`

) transforms
to (`x2`

,`y2`

) then (`x1`

+`dx1`

,`y1`

+`dy1`

) will transform to
(`x1`

+`dx2`

,`y1`

+`dy2`

) for all values of `x1`

and `x2`

.

`dx`

in/out X component of a distance vector

`dy`

in/out Y component of a distance vector

## Trait Implementations

This method returns an ordering between `self`

and `other`

values if one exists. Read more

This method tests less than (for `self`

and `other`

) and is used by the `<`

operator. Read more

This method tests less than or equal to (for `self`

and `other`

) and is used by the `<=`

operator. Read more

This method tests greater than (for `self`

and `other`

) and is used by the `>`

operator. Read more

Returns the type identifier of `Self`

.

## Auto Trait Implementations

`impl RefUnwindSafe for Matrix`

`impl UnwindSafe for Matrix`

## Blanket Implementations

Mutably borrows from an owned value. Read more

`impl<'a, T, C> FromValueOptional<'a> for T where`

C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError>,

T: FromValue<'a, Checker = C>,