perf: reuse previewed and spotted widgets when possible (#3765)

This commit is contained in:
三咲雅 misaki masa 2026-03-15 15:18:58 +08:00 committed by GitHub
parent fa1ee46edc
commit d22c96b69c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 197 additions and 55 deletions

View file

@ -24,7 +24,7 @@ impl Widget for Preview<'_> {
for w in &lock.data {
let rect = w.area().transform(|p| self.core.mgr.area(p));
if rect.intersection(win) == rect {
w.clone().render(rect, buf);
w.render(rect, buf);
}
}
}

View file

@ -18,7 +18,7 @@ impl Widget for Spot<'_> {
for w in &lock.data {
let rect = w.area().transform(|p| self.core.mgr.area(p));
if rect.intersection(win) == rect {
w.clone().render(rect, buf);
w.render(rect, buf);
}
}
}