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]

[src]

Creates a new drawing context.

[src]

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.

[src]

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.

[src]

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.

[src]

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.

[src]

Stores the current transform as new view.

[src]

Computes the current view size.

Trait Implementations

impl Transformed for Context
[src]

[src]

Appends transform to the current one.

[src]

Prepends transform to the current one.

[src]

Translate x and y in local coordinates.

[src]

Rotate radians in local coordinates.

[src]

Orients x axis to look at point locally. Read more

[src]

Scales in local coordinates.

[src]

Shears in local coordinates.

[src]

Rotates degrees in local coordinates.

[src]

Scales in both directions in local coordinates.

[src]

Flips vertically in local coordinates.

[src]

Flips horizontally in local coordinates.

[src]

Flips horizontally and vertically in local coordinates.

impl Copy for Context
[src]

impl Clone for Context
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more