Skip to content

Commit

Permalink
fix bug with floating position
Browse files Browse the repository at this point in the history
When floating position was used it was incorrectly assumed that all other children were floating. This would lead to unreachable code causing a panic.
  • Loading branch information
AustinJ235 committed Mar 22, 2024
1 parent 5c6f994 commit 510d0e3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/interface/bin/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,10 @@ impl Bin {

let sibling_style = sibling.style_copy();

if sibling_style.position != Some(BinPosition::Floating) {
continue;
}

let mut sibling_width = match sibling_style.width {
Some(some) => some,
None => {
Expand Down
2 changes: 1 addition & 1 deletion src/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ impl Renderer {
let mut metrics_state_op = self
.window
.renderer_metrics_enabled()
.then(|| MetricsState::new());
.then(MetricsState::new);

'render_loop: loop {
assert!(update_after_acquire_wait.is_none());
Expand Down
2 changes: 1 addition & 1 deletion src/render/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ pub fn spawn(
}

let mut update_recv_count = 0;
let mut total_ovd_metrics_op = metrics_enabled.then(|| OVDPerfMetrics::default());
let mut total_ovd_metrics_op = metrics_enabled.then(OVDPerfMetrics::default);

// TODO: what happens if a thread panics before all data is received?
while update_recv_count < update_count {
Expand Down

0 comments on commit 510d0e3

Please sign in to comment.