mirror of
https://github.com/emilk/egui.git
synced 2026-06-26 14:49:06 -04:00
Fix CentralPanel::show_inside_dyn to round panel_rect (#7868)
While using CentralPanel::show_inside_dyn inside egui_tiles I've noticed that sometimes it renders "Unaligned" message with certain tile positions. Match SidePanel behavior by calling round_ui() on the panel rect. <img width="364" height="173" alt="image" src="https://github.com/user-attachments/assets/08a9cef3-67f8-49af-9ea7-75aff711186a" /> --------- Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
This commit is contained in:
@@ -1066,7 +1066,7 @@ impl CentralPanel {
|
||||
id,
|
||||
UiBuilder::new()
|
||||
.layer_id(LayerId::background())
|
||||
.max_rect(ctx.available_rect().round_ui()),
|
||||
.max_rect(ctx.available_rect()),
|
||||
);
|
||||
panel_ui.set_clip_rect(ctx.content_rect());
|
||||
|
||||
|
||||
@@ -798,7 +798,7 @@ impl Context {
|
||||
Id::new((ctx.viewport_id(), "__top_ui")),
|
||||
UiBuilder::new()
|
||||
.layer_id(LayerId::background())
|
||||
.max_rect(ctx.available_rect().round_ui()),
|
||||
.max_rect(ctx.available_rect()),
|
||||
);
|
||||
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
use crate::{Layout, Painter, Pos2, Rect, Region, Vec2, grid, vec2};
|
||||
use emath::GuiRounding as _;
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
use crate::{Align2, Color32, Stroke};
|
||||
@@ -92,6 +93,7 @@ impl Placer {
|
||||
} else {
|
||||
self.layout.available_rect_before_wrap(&self.region)
|
||||
}
|
||||
.round_ui()
|
||||
}
|
||||
|
||||
/// Amount of space available for a widget.
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:604f716e687fc26abba92769fe2dae75d850b18598d2e8a9524451ab0f760251
|
||||
size 65403
|
||||
oid sha256:56b44d26946770c0878e11e3197633697ad339a7e8fcffe7279a6b4c45cd3582
|
||||
size 65384
|
||||
|
||||
Reference in New Issue
Block a user