From 1da3a6704671040a723d9fb07856e03b2de7b5ce Mon Sep 17 00:00:00 2001 From: hodasemi Date: Sun, 14 May 2023 16:36:31 +0200 Subject: [PATCH] Remove new polygon button in 3d view --- src/main.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index 6acc4f5..3af9b97 100644 --- a/src/main.rs +++ b/src/main.rs @@ -83,15 +83,17 @@ fn update_ui_side_panel( } } - if global_state.polygon_started { - if let Some(polygon) = object_infos.active_polygon() { - for (index, point) in polygon.points().iter().enumerate() { - ui.label(&format!("{}: ({}, {})", index, point.x, point.y)); + if global_state.view_2d { + if global_state.polygon_started { + if let Some(polygon) = object_infos.active_polygon() { + for (index, point) in polygon.points().iter().enumerate() { + ui.label(&format!("{}: ({}, {})", index, point.x, point.y)); + } + } + } else { + if ui.button("New Polygon").clicked() { + global_state.polygon_started = true; } - } - } else { - if ui.button("New Polygon").clicked() { - global_state.polygon_started = true; } } });