Struct winit::dpi::LogicalPosition[][src]

pub struct LogicalPosition {
    pub x: f64,
    pub y: f64,
}

A position represented in logical pixels.

The position is stored as floats, so please be careful. Casting floats to integers truncates the fractional part, which can cause noticable issues. To help with that, an Into<(i32, i32)> implementation is provided which does the rounding for you.

Fields

Methods

impl LogicalPosition
[src]

Trait Implementations

impl Debug for LogicalPosition
[src]

Formats the value using the given formatter. Read more

impl Copy for LogicalPosition
[src]

impl Clone for LogicalPosition
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for LogicalPosition
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl From<(f64, f64)> for LogicalPosition
[src]

Performs the conversion.

impl From<(i32, i32)> for LogicalPosition
[src]

Performs the conversion.

impl Into<(f64, f64)> for LogicalPosition
[src]

Performs the conversion.

impl Into<(i32, i32)> for LogicalPosition
[src]

Note that this rounds instead of truncating.

Auto Trait Implementations