pub(crate) fn update_pos(&mut self, pos: Vec2) {
        let prev_pos = self.pos.pos;
        self.pos.pos = pos;
        match &mut self.shape_type {
            ShapeType::Drawing(s) => {
                let self_pos = self.pos.pos;
                s.iter_mut().for_each(|v| {
                    v.update_pos(self_pos + pos);
                });
            }
            ShapeType::Line { from, to } => {
                let delta = pos - prev_pos;
                *from += delta;
                *to += delta;
            }
            ShapeType::Path {
                keypoints,
                closed: _,
            } => {
                keypoints.iter_mut().for_each(|v| {
                    let delta = pos - prev_pos;
                    *v += delta;
                });
            }
            ShapeType::Circle { .. } => {}
            ShapeType::Image { .. } => {}
            ShapeType::Text { .. } => {}
        }
    }
/// Update the position of the shape.
Update the position of the shape.
Update the position of the shape .
pub(crate) fn update_pos(&mut self, pos: Vec2) {
        let prev_pos = self.pos.pos;
        self.pos.pos = pos;
        match &mut self.shape_type {
            ShapeType::Drawing(s) => {
                let self_pos = self.pos.pos;
                s.iter_mut().for_each(|v| {
                    v.update_pos(self_pos + pos);
                });
            }
            ShapeType::Line { from, to } => {
                let delta = pos - prev_pos;
                *from += delta;
                *to += delta;
            }
            ShapeType::Path {
                keypoints,
                closed: _,
            } => {
                keypoints.iter_mut().for_each(|v| {
                    let delta = pos - prev_pos;
                    *v += delta;
                });
            }
            ShapeType::Circle { .. } => {}
            ShapeType::Image { .. } => {}
            ShapeType::Text { .. } => {}
        }
    }
pub ( crate ) fn update_pos ( & mut self , pos : Vec2 ) { let prev_pos = self . pos . pos ; self . pos . pos = pos ; match & mut self . shape_type { ShapeType :: Drawing ( s ) => { let self_pos = self . pos . pos ; s . iter_mut ( ) . for_each ( | v | { v . update_pos ( self_pos + pos ) ; } ) ; } ShapeType :: Line { from , to } => { let delta = pos - prev_pos ; * from += delta ; * to += delta ; } ShapeType :: Path { keypoints , closed : _ , } => { keypoints . iter_mut ( ) . for_each ( | v | { let delta = pos - prev_pos ; * v += delta ; } ) ; } ShapeType :: Circle { .. } => { } ShapeType :: Image { .. } => { } ShapeType :: Text { .. } => { } } }
Update the position of the shape.
Update the position of the shape .
&mut self
pos
Vec2
&mut self
pos
Vec2