Skip to content
This repository has been archived by the owner on Jan 11, 2020. It is now read-only.

Commit

Permalink
Simplified view branch of get_geometry
Browse files Browse the repository at this point in the history
  • Loading branch information
Timidger committed Jan 13, 2017
1 parent 8454ed0 commit 9129c5f
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/layout/core/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,8 @@ impl Container {
size: size
}),
Container::Container { geometry, .. } => Some(geometry),
Container::View { ref handle, ref effective_geometry,
ref prev_geometry, ..} => {
let actual_geo = prev_geometry.or_else(|| handle.get_geometry());
if actual_geo != Some(*effective_geometry) {
Some(*effective_geometry)
} else {
actual_geo
}
Container::View { effective_geometry, prev_geometry, ..} => {
Some(prev_geometry.unwrap_or(effective_geometry))
},
}
}
Expand Down

0 comments on commit 9129c5f

Please sign in to comment.