Merge pull request #10184 from penpot/azazeln28-fix-frame-stroke

🐛 Board stroke disappears when a layer is placed inside
This commit is contained in:
Alejandro Alonso 2026-06-16 09:32:14 +02:00 committed by GitHub
commit 92c9517322
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -217,20 +217,20 @@ impl NodeRenderState {
#[derive(Clone)] #[derive(Clone)]
pub struct FocusMode { pub struct FocusMode {
shapes: Vec<Uuid>, shapes: Vec<Uuid>,
active: bool, depth: u32,
} }
impl FocusMode { impl FocusMode {
pub fn new() -> Self { pub fn new() -> Self {
FocusMode { FocusMode {
shapes: Vec::new(), shapes: Vec::new(),
active: false, depth: 0,
} }
} }
pub fn clear(&mut self) { pub fn clear(&mut self) {
self.shapes.clear(); self.shapes.clear();
self.active = false; self.depth = 0;
} }
pub fn set_shapes(&mut self, shapes: Vec<Uuid>) { pub fn set_shapes(&mut self, shapes: Vec<Uuid>) {
@ -244,23 +244,23 @@ impl FocusMode {
} }
pub fn enter(&mut self, id: &Uuid) { pub fn enter(&mut self, id: &Uuid) {
if !self.active && self.should_focus(id) { if self.should_focus(id) {
self.active = true; self.depth += 1;
} }
} }
pub fn exit(&mut self, id: &Uuid) { pub fn exit(&mut self, id: &Uuid) {
if self.active && self.should_focus(id) { if self.should_focus(id) && self.depth > 0 {
self.active = false; self.depth -= 1;
} }
} }
pub fn is_active(&self) -> bool { pub fn is_active(&self) -> bool {
self.active self.depth > 0
} }
pub fn reset(&mut self) { 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); let layer_rec = skia::canvas::SaveLayerRec::default().paint(&paint);
self.surfaces.canvas(target_surface).save_layer(&layer_rec); self.surfaces.canvas(target_surface).save_layer(&layer_rec);
} }
self.focus_mode.enter(&element.id);
} }
#[inline] #[inline]