Fix order

This commit is contained in:
hodasemi 2024-04-22 09:48:32 +02:00
parent 75e92513fe
commit 8731bf1f7e

View file

@ -361,6 +361,19 @@ impl Grid {
child_gridable.set_layer(self.framable.ui_layer())?; 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 self.visible() {
if let Some(child_visibility) = child.visibility() { if let Some(child_visibility) = child.visibility() {
child_visibility.set_visibility(true)?; child_visibility.set_visibility(true)?;
@ -375,19 +388,6 @@ impl Grid {
let weak = child_state.downgrade(); 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 // insert the element
for x in pos_x..(pos_x + dim_x as usize) { for x in pos_x..(pos_x + dim_x as usize) {
for y in pos_y..(pos_y + dim_y as usize) { for y in pos_y..(pos_y + dim_y as usize) {