Struct graphics::context::Context [] [src]

pub struct Context {
    pub viewport: Option<Viewport>,
    pub view: Matrix2d,
    pub transform: Matrix2d,
    pub draw_state: DrawState,
}

Drawing 2d context.

Fields

Viewport information.

View transformation.

Current transformation.

Current draw state settings.

Methods

impl Context
[src]

Creates a new drawing context.

Creates a new context with absolute transform in point coordinates.

This function assumes the default coordinate system being centered with x axis pointing to the right and y axis pointing up.

Returns a drawing context with origin in the upper left corner and x axis pointing to the right and y axis pointing down.

Creates a new drawing context in absolute coordinates.

This function assumes the default coordinate system being centered with x axis pointing to the right and y axis pointing up.

Returns a drawing context with origin in the upper left corner and x axis pointing to the right and y axis pointing down.

Moves the current transform to the view coordinate system.

This is usually [0.0, 0.0] in the upper left corner with the x axis pointing to the right and the y axis pointing down.

Moves the current transform to the default coordinate system.

This is usually [0.0, 0.0] in the center with the x axis pointing to the right and the y axis pointing up.

Stores the current transform as new view.

Computes the current view size.

Trait Implementations

impl Transformed for Context
[src]

Appends transform to the current one.

Prepends transform to the current one.

Translate x an y in local coordinates.

Rotate radians in local coordinates.

Orients x axis to look at point locally. Read more

Scales in local coordinates.

Shears in local coordinates.

Rotates degrees in local coordinates.

Scales in both directions in local coordinates.

Flips vertically in local coordinates.

Flips horizontally in local coordinates.

Flips horizontally and vertically in local coordinates.

impl Copy for Context
[src]

impl Clone for Context
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more