Skip to content

Commit

Permalink
#51. avoid cloning
Browse files Browse the repository at this point in the history
  • Loading branch information
wtholliday committed Aug 19, 2023
1 parent d6ff9bb commit 17fd9e5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/views/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,12 @@ where
VAlignment::Middle,
);

args.cx.layout.entry(path.clone()).or_default().offset = child_offset;
match args.cx.layout.get_mut(path) {
Some(boxref) => boxref.offset = child_offset,
None => {
args.cx.layout.insert(path.clone(), LayoutBox { rect: LocalRect::default(), offset: child_offset });
}
}

path.pop();

Expand Down

0 comments on commit 17fd9e5

Please sign in to comment.