1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
//! Transformations for graphics objects

use coord::Coord;

/// Transform operations
pub trait Transform {
    /// Move the origin of an object by a given number of (x, y) pixels, returning a new object
    fn translate(&self, by: Coord) -> Self;

    /// Move the origin of an object by a given number of (x, y) pixels, mutating the object
    /// in place
    fn translate_mut(&mut self, by: Coord) -> &mut Self;
}