Fix order
This commit is contained in:
parent
75e92513fe
commit
8731bf1f7e
1 changed files with 13 additions and 13 deletions
|
@ -361,6 +361,19 @@ impl Grid {
|
|||
child_gridable.set_layer(self.framable.ui_layer())?;
|
||||
}
|
||||
|
||||
// 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 => (),
|
||||
}
|
||||
|
||||
if self.visible() {
|
||||
if let Some(child_visibility) = child.visibility() {
|
||||
child_visibility.set_visibility(true)?;
|
||||
|
@ -375,19 +388,6 @@ 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