Fix bug in `Context::parent_viewport_id` (#4190)
* Closes #4084 Fix : Display parent viewport id Issues
This commit is contained in:
parent
d449cb1d48
commit
1b34289608
|
|
@ -592,11 +592,11 @@ impl ContextImpl {
|
||||||
///
|
///
|
||||||
/// For the root viewport this will return [`ViewportId::ROOT`].
|
/// For the root viewport this will return [`ViewportId::ROOT`].
|
||||||
pub(crate) fn parent_viewport_id(&self) -> ViewportId {
|
pub(crate) fn parent_viewport_id(&self) -> ViewportId {
|
||||||
self.viewport_stack
|
let viewport_id = self.viewport_id();
|
||||||
.last()
|
*self
|
||||||
.copied()
|
.viewport_parents
|
||||||
.unwrap_or_default()
|
.get(&viewport_id)
|
||||||
.parent
|
.unwrap_or(&ViewportId::ROOT)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn all_viewport_ids(&self) -> ViewportIdSet {
|
fn all_viewport_ids(&self) -> ViewportIdSet {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue