From df7f0f26dfd25c8917784fbf0eb270ab57fe3464 Mon Sep 17 00:00:00 2001 From: Ruben van de Ven Date: Mon, 4 Aug 2025 16:09:01 +0200 Subject: [PATCH] Fix preview clip mask hiding dac id --- src/main.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main.rs b/src/main.rs index bc66504..66a6fb9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -978,16 +978,7 @@ fn view_laser_preview(app: &App, model: &GuiModel, frame: Frame) { // 1. get config for laser let config = model.per_laser_config.get(&dac_id).expect("Selected stream not found in configs"); - // 2 draw identifier of laser - draw.text(&format!("{} {:?}", config.name, dac_id)) - .h(win_rect.h()) - .font_size(10) - .align_text_bottom() - .left_justify() - .color(WHITE) - .w(win_rect.w()); - - // 3. clipping mask + its anchor points + // 2. clipping mask + its anchor points let clip_points: Vec<[f32;2]> = config.filters.clip.mask.iter().map(|p| { [p[0] * hw, p[1] * hh] @@ -1002,14 +993,14 @@ fn view_laser_preview(app: &App, model: &GuiModel, frame: Frame) { } draw.polygon() - .color(srgba(0.3, 0.3, 0.3, 1.)) + .color(srgba(0.2, 0.2, 0.2, 0.3)) .stroke(PINK) .stroke_weight(thickness) .join_round() .points(clip_points); - // 4. current shape of the laser + // 3. current shape of the laser let current_points: LaserPoints = (&model.current_lines).into(); @@ -1048,6 +1039,15 @@ fn view_laser_preview(app: &App, model: &GuiModel, frame: Frame) { .points_colored(vertices); } + // 4. Last, draw identifier of laser on top + draw.text(&format!("{} {:?}", config.name, dac_id)) + .h(win_rect.h()) + .font_size(10) + .align_text_bottom() + .left_justify() + .color(WHITE) + .w(win_rect.w()); + } }