From 77198bd2f0d814a9768a30159ff046f09e109245 Mon Sep 17 00:00:00 2001 From: Arjo Chakravarty Date: Fri, 21 Jul 2023 14:53:07 +0800 Subject: [PATCH] Clean ups Signed-off-by: Arjo Chakravarty --- rmf_site_editor/src/site/offscreen_render_tests.rs | 13 ++++++------- rmf_site_editor/src/site/screenspace_selection.rs | 4 +++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/rmf_site_editor/src/site/offscreen_render_tests.rs b/rmf_site_editor/src/site/offscreen_render_tests.rs index 4c2387c6..019b2768 100644 --- a/rmf_site_editor/src/site/offscreen_render_tests.rs +++ b/rmf_site_editor/src/site/offscreen_render_tests.rs @@ -226,11 +226,11 @@ pub fn buffer_to_selection( if let Some(entity) = color_map.get_entity(&(pixel.0[0], pixel.0[1], pixel.0[2])) { if Layer == POINT_PICKING_LAYER { let Ok((_, parent)) = selections.get(*entity) else { - println!("No parent found"); + error!("No parent found"); continue; }; let Ok(_) = anchors.get(parent.get()) else { - println!("Not an anchor"); + error!("Not an anchor"); continue; }; if (mouse_button_input.just_released(MouseButton::Left)) { @@ -240,24 +240,23 @@ pub fn buffer_to_selection( } } - if Layer == LINE_PICKING_LAYER { + /*if Layer == LINE_PICKING_LAYER { // TODO(arjoc): Make picker contain parent entity let result: Vec<_> = lane_segments .iter() .filter(|(_, segment)| segment.picker == *entity) .collect(); - if result.len() > 0usize { - println!("Not a lane segment"); + if result.len() == 0usize { continue; - } + } if mouse_button_input.just_released(MouseButton::Left) { select_event.send(Select(Some(*entity))); } else { hover_event.send(Hover(Some(*entity))); } - } + }*/ } else { println!("Uh-oh can't find color {:?}", pixel); //Color::as_linear_rgba_f32(self) diff --git a/rmf_site_editor/src/site/screenspace_selection.rs b/rmf_site_editor/src/site/screenspace_selection.rs index 80981eb2..42d2221a 100644 --- a/rmf_site_editor/src/site/screenspace_selection.rs +++ b/rmf_site_editor/src/site/screenspace_selection.rs @@ -8,6 +8,8 @@ use crate::interaction::{LINE_PICKING_LAYER, POINT_PICKING_LAYER}; use super::{ImageToSave, PointAsset}; +const SCREEN_SPACE_POINT_SIZE_SELECTION: f32 = 40.0; + #[derive(Debug, Clone)] pub struct ScreenspacePolyline { pub start: Vec3, @@ -98,7 +100,7 @@ impl ColorEntityMap { let color = Color::rgb_u8(r, g, b); let material = point_materials.add(PointsMaterial { - point_size: 70.0, // Defines the size of the points. + point_size: SCREEN_SPACE_POINT_SIZE_SELECTION, // Defines the size of the points. perspective: false, // Specify whether points' size is attenuated by the camera depth. circle: true, use_vertex_color: false,