SdfTerm: simplify get_order()
This commit is contained in:
parent
b708545b96
commit
83386d5bd9
1 changed files with 9 additions and 13 deletions
|
@ -92,20 +92,18 @@ impl SdfTerm {
|
||||||
|
|
||||||
pub fn get_order(&mut self) -> Vec<LayerId> {
|
pub fn get_order(&mut self) -> Vec<LayerId> {
|
||||||
vec![
|
vec![
|
||||||
self.bg_layers.iter().filter(
|
self.bg_layers.iter(),
|
||||||
|(_pt, (active, _id))| *active
|
self.fg_layers.iter()
|
||||||
)
|
|
||||||
.collect::<Vec<_>>()
|
|
||||||
.into_iter(),
|
|
||||||
self.fg_layers.iter().filter(
|
|
||||||
|(_pt, (active, _id))| *active
|
|
||||||
)
|
|
||||||
.collect::<Vec<_>>()
|
|
||||||
.into_iter()
|
|
||||||
]
|
]
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.flatten()
|
.flatten()
|
||||||
.map(|(_,(_,id))| (*id).into())
|
.filter_map(
|
||||||
|
|(_pt,(active,id))|
|
||||||
|
if *active {
|
||||||
|
Some((*id).into())
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
})
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -274,8 +272,6 @@ async fn main() {
|
||||||
Point2::new(0,0) .. Point2::new(new_size.x, new_size.y)
|
Point2::new(0,0) .. Point2::new(new_size.x, new_size.y)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
TerminalEvent::Input(Event::Key(Key::Ctrl('c'))) |
|
TerminalEvent::Input(Event::Key(Key::Ctrl('c'))) |
|
||||||
TerminalEvent::Input(Event::Key(Key::Ctrl('g'))) |
|
TerminalEvent::Input(Event::Key(Key::Ctrl('g'))) |
|
||||||
|
|
Loading…
Reference in a new issue