summaryrefslogtreecommitdiff
path: root/src/layout/incremental.rs
diff options
context:
space:
mode:
authorMartin <mhaug@live.de>2021-06-18 13:01:55 +0200
committerMartin <mhaug@live.de>2021-06-18 13:01:55 +0200
commit80a9b300d1acb8821ac0600aad3d2135ad9587bd (patch)
tree6626ba8891fa4db4e3a1cb13f7f4b27fc05989bf /src/layout/incremental.rs
parent7db78d83bedf62adea0d715c9a2a179ce23a1a48 (diff)
Ref count the frames
Diffstat (limited to 'src/layout/incremental.rs')
-rw-r--r--src/layout/incremental.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/layout/incremental.rs b/src/layout/incremental.rs
index 7857f33c..a5c3cea3 100644
--- a/src/layout/incremental.rs
+++ b/src/layout/incremental.rs
@@ -26,7 +26,7 @@ impl LayoutCache {
where
F: FnMut(usize) -> bool,
{
- self.frames.retain(|_, b| f(b.level));
+ self.frames.retain(|_, entry| f(entry.level));
}
/// Amount of items in the cache.
@@ -39,14 +39,14 @@ impl LayoutCache {
/// Cached frames from past layouting.
pub struct FramesEntry {
/// The cached frames for a node.
- pub frames: Vec<Constrained<Frame>>,
+ pub frames: Vec<Constrained<Rc<Frame>>>,
/// How nested the frame was in the context is was originally appearing in.
pub level: usize,
}
impl FramesEntry {
/// Checks if the cached [`Frame`] is valid for the given regions.
- pub fn check(&self, mut regions: Regions) -> Option<Vec<Constrained<Frame>>> {
+ pub fn check(&self, mut regions: Regions) -> Option<Vec<Constrained<Rc<Frame>>>> {
for (i, frame) in self.frames.iter().enumerate() {
if (i != 0 && !regions.next()) || !frame.constraints.check(&regions) {
return None;