Hide the old element on attach to grid
This commit is contained in:
parent
bb27a8cda0
commit
75e92513fe
1 changed files with 13 additions and 0 deletions
|
@ -375,6 +375,19 @@ impl Grid {
|
|||
|
||||
let weak = child_state.downgrade();
|
||||
|
||||
// disable the old element
|
||||
match &grid[pos_x][pos_y] {
|
||||
ChildState::Some { child, .. } => {
|
||||
if self.visible() {
|
||||
if let Some(child_visibility) = child.visibility() {
|
||||
child_visibility.set_visibility(false)?;
|
||||
}
|
||||
}
|
||||
}
|
||||
ChildState::Extend { .. } => todo!(),
|
||||
ChildState::None => (),
|
||||
}
|
||||
|
||||
// insert the element
|
||||
for x in pos_x..(pos_x + dim_x as usize) {
|
||||
for y in pos_y..(pos_y + dim_y as usize) {
|
||||
|
|
Loading…
Reference in a new issue