From c54ab3bd345f5e4c6a838cb5da2e5142b399c3ce Mon Sep 17 00:00:00 2001 From: Aitor Moreno Date: Mon, 15 Jun 2026 13:48:20 +0200 Subject: [PATCH] :bug: Fix frame stroke --- render-wasm/src/render.rs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/render-wasm/src/render.rs b/render-wasm/src/render.rs index fb3fffecd8..ec72db0480 100644 --- a/render-wasm/src/render.rs +++ b/render-wasm/src/render.rs @@ -217,20 +217,20 @@ impl NodeRenderState { #[derive(Clone)] pub struct FocusMode { shapes: Vec, - active: bool, + depth: u32, } impl FocusMode { pub fn new() -> Self { FocusMode { shapes: Vec::new(), - active: false, + depth: 0, } } pub fn clear(&mut self) { self.shapes.clear(); - self.active = false; + self.depth = 0; } pub fn set_shapes(&mut self, shapes: Vec) { @@ -244,23 +244,23 @@ impl FocusMode { } pub fn enter(&mut self, id: &Uuid) { - if !self.active && self.should_focus(id) { - self.active = true; + if self.should_focus(id) { + self.depth += 1; } } pub fn exit(&mut self, id: &Uuid) { - if self.active && self.should_focus(id) { - self.active = false; + if self.should_focus(id) && self.depth > 0 { + self.depth -= 1; } } pub fn is_active(&self) -> bool { - self.active + self.depth > 0 } pub fn reset(&mut self) { - self.active = false; + self.depth = 0; } } @@ -2521,8 +2521,6 @@ impl RenderState { let layer_rec = skia::canvas::SaveLayerRec::default().paint(&paint); self.surfaces.canvas(target_surface).save_layer(&layer_rec); } - - self.focus_mode.enter(&element.id); } #[inline]