/// Translate location by this much, in-place
Translate location by this much, in-place
Translate location by this much in - place
pub fn translate(&mut self, delta: Vec2) {
        match self {
            PaintCmd::Noop => {}
            PaintCmd::Vec(commands) => {
                for command in commands {
                    command.translate(delta);
                }
            }
            PaintCmd::Circle { center, .. } => {
                *center += delta;
            }
            PaintCmd::LineSegment { points, .. } => {
                for p in points {
                    *p += delta;
                }
            }
            PaintCmd::Path { points, .. } => {
                for p in points {
                    *p += delta;
                }
            }
            PaintCmd::Rect { rect, .. } => {
                *rect = rect.translate(delta);
            }
            PaintCmd::Text { pos, .. } => {
                *pos += delta;
            }
            PaintCmd::Triangles(triangles) => {
                triangles.translate(delta);
            }
        }
    }
pub fn translate ( & mut self , delta : Vec2 ) { match self { PaintCmd :: Noop => { } PaintCmd :: Vec ( commands ) => { for command in commands { command . translate ( delta ) ; } } PaintCmd :: Circle { center , .. } => { * center += delta ; } PaintCmd :: LineSegment { points , .. } => { for p in points { * p += delta ; } } PaintCmd :: Path { points , .. } => { for p in points { * p += delta ; } } PaintCmd :: Rect { rect , .. } => { * rect = rect . translate ( delta ) ; } PaintCmd :: Text { pos , .. } => { * pos += delta ; } PaintCmd :: Triangles ( triangles ) => { triangles . translate ( delta ) ; } } }
Translate location by this much, in-place
Translate location by this much in - place
&mut self
delta
Vec2