~vpzom/savg

8bd85aa185eb9d0a4253345f01c6a2dfc7122f85 — Colin Reeder 5 years ago 15be428
Select newly-added objects
1 files changed, 6 insertions(+), 2 deletions(-)

M src/main.rs
M src/main.rs => src/main.rs +6 -2
@@ 137,7 137,7 @@ fn main() {
                ToolMode::Rectangle => {
                    let mut document = instance.document.write().unwrap();

                    document.content.push(Object::new_random_id(Element::Rect(Rect {
                    let obj = Object::new_random_id(Element::Rect(Rect {
                        position: Point2 {
                            x: pos_x,
                            y: pos_y,


@@ 153,7 153,11 @@ fn main() {
                            width: 100.0,
                            height: 50.0,
                        },
                    })));
                    }));

                    *instance.selection.write().unwrap() = Some(obj.id());
                    document.content.push(obj);

                    instance.queue_repaint();
                },
                ToolMode::Select => {