[][src]Trait embedded_graphics::coord::ToUnsigned

pub trait ToUnsigned {
    fn to_unsigned(self) -> UnsignedCoord;

Convert a value to an unsigned coordinate

Required methods

fn to_unsigned(self) -> UnsignedCoord

Convert the signed coordinate to an unsigned coordinate

Loading content...


impl ToUnsigned for Coord[src]

fn to_unsigned(self) -> UnsignedCoord[src]

Convert to a positive-only coordinate, clamping negative values to zero

use embedded_graphics::coord::Coord;

use embedded_graphics::unsignedcoord::UnsignedCoord;

let coord = Coord::new(-5, 10);

assert_eq!(coord.to_unsigned(), UnsignedCoord::new(0, 10));

Loading content...