1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 22:53:14 -04:00

Fix StripBuilder not allocating its used space (#3957)

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 <https://github.com/emilk/egui/issues/3956>.
This commit is contained in:
Ivan
2024-02-05 08:34:46 +01:00
committed by GitHub
parent 1636b6af08
commit a6a9501d12

View File

@@ -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);
@@ -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)
}