mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 05:10:03 -04:00
Fix bug in Context::parent_viewport_id (#4190)
* Closes #4084 Fix : Display parent viewport id Issues
This commit is contained in:
@@ -592,11 +592,11 @@ impl ContextImpl {
|
||||
///
|
||||
/// For the root viewport this will return [`ViewportId::ROOT`].
|
||||
pub(crate) fn parent_viewport_id(&self) -> ViewportId {
|
||||
self.viewport_stack
|
||||
.last()
|
||||
.copied()
|
||||
.unwrap_or_default()
|
||||
.parent
|
||||
let viewport_id = self.viewport_id();
|
||||
*self
|
||||
.viewport_parents
|
||||
.get(&viewport_id)
|
||||
.unwrap_or(&ViewportId::ROOT)
|
||||
}
|
||||
|
||||
fn all_viewport_ids(&self) -> ViewportIdSet {
|
||||
|
||||
Reference in New Issue
Block a user