Skip to content

Commit

Permalink
Fix StripBuilder not allocating its used space (#3957)
Browse files Browse the repository at this point in the history
At crates\egui_extras\src\layout.rs :

Allocate allocation_rect instead of max_rect.
Go back from this:
```
let response = self.ui.allocate_rect(max_rect, self.sense);
let response = response.with_new_rect(allocation_rect);
return (used_rect, response)
```

to this:
```
let response = self.ui.allocate_rect(allocation_rect, self.sense);
return (used_rect, response)
```

In order to allocate the

Closes <#3956>.
  • Loading branch information
IVAN-MK7 authored Feb 5, 2024
1 parent 1636b6a commit a6a9501
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions crates/egui_extras/src/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ impl<'l> StripLayout<'l> {
);
}

let response = self.ui.allocate_rect(max_rect, self.sense);
let used_rect = self.cell(flags, max_rect, add_cell_contents);

self.set_pos(max_rect);
Expand All @@ -156,7 +155,7 @@ impl<'l> StripLayout<'l> {
max_rect.union(used_rect)
};

let response = response.with_new_rect(allocation_rect);
let response = self.ui.allocate_rect(allocation_rect, self.sense);

(used_rect, response)
}
Expand Down

0 comments on commit a6a9501

Please sign in to comment.