`set_clip_rect` draws over `SidePanel` when children widgets exceed the available space
- Dominant language
- Rust
- Stars
- 30.6k
- Forks
- 2.1k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 72
Description
**Describe the bug**



**To Reproduce**
Steps to reproduce the behavior:
Minimal reproduction project:
```rs
use eframe::egui::*;
fn main() -> Result<(), eframe::Error> {
let options = eframe::NativeOptions {
viewport: ViewportBuilder::default(),
..Default::default()
};
eframe::run_native(
"Image Cleanup",
options,
Box::new(|cc| Box::new(ImageCleanup {})),
)
}
struct ImageCleanup {}
impl eframe::App for ImageCleanup {
fn update(&mut self, ctx: &Context, _frame: &mut eframe::Frame) {
SidePanel::right("parameters").show(ctx, |ui| {
Grid::new("parameters")
.spacing([40.0, 4.0])
.striped(true)
.show(ui, |ui| {
ui.label("Hello world!");
ui.end_row();
});
});
SidePanel::left("preview_tools").show(ctx, |ui| {
Grid::new("preview_parameters")
.striped(true)
.show(ui, |ui| {
ui.label("Hello world!");
ui.end_row();
});
});
CentralPanel::default().show(ctx, |ui| {
ui.set_clip_rect(ui.available_rect_before_wrap());
ui.add(Button::new("Hi").min_size(
ui.available_size() * ((ctx.frame_nr() as f32 / 60.0).sin().abs() + 0.5),
));
ctx.request_repaint();
});
}
}
```
**Expected behavior**
Don't draw on top of the side panel, or if this is intended behavior, document it and describe
**Screenshots**
**Desktop (please complete the following information):**
- OS: Windows 11
Contributor guide
Research direction
Start by running the minimal Rust reproduction with the referenced SidePanel, CentralPanel, and set_clip_rect calls, then inspect those APIs and their clipping behavior in egui. Done means overflowing CentralPanel children no longer draw over the side panels, or the intended behavior is documented; verify the result against the reproduction on Windows 11.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100