mirror of
https://github.com/sxyazi/yazi.git
synced 2026-05-13 08:16:40 +00:00
perf: reuse previewed and spotted widgets when possible (#3765)
This commit is contained in:
parent
fa1ee46edc
commit
d22c96b69c
12 changed files with 197 additions and 55 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue