mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-05 10:28:27 +00:00
Prepare to support nested operations
This commit is contained in:
parent
050b9357c2
commit
d7a183b6fc
@ -92,10 +92,8 @@ impl Renderer {
|
||||
return Ok(());
|
||||
};
|
||||
|
||||
let vertices =
|
||||
Geometry::vertices(&self.device, selected_operation.as_ref());
|
||||
let triangles =
|
||||
Geometry::triangles(&self.device, selected_operation.as_ref());
|
||||
let vertices = Geometry::vertices(&self.device, &selected_operation);
|
||||
let triangles = Geometry::triangles(&self.device, &selected_operation);
|
||||
|
||||
let mut encoder = self
|
||||
.device
|
||||
|
@ -15,12 +15,20 @@ impl OperationView {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn operations(&self) -> Vec<(Box<dyn Operation>, bool)> {
|
||||
pub fn operations(&self) -> Vec<(Self, bool)> {
|
||||
self.operation
|
||||
.children()
|
||||
.into_iter()
|
||||
.enumerate()
|
||||
.map(|(i, op)| (op, Some(i) == self.selected))
|
||||
.map(|(i, op)| {
|
||||
(
|
||||
OperationView {
|
||||
operation: op,
|
||||
selected: None,
|
||||
},
|
||||
Some(i) == self.selected,
|
||||
)
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
@ -40,7 +48,7 @@ impl OperationView {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn selected(&self) -> Option<Box<dyn Operation>> {
|
||||
pub fn selected(&self) -> Option<Self> {
|
||||
let selected = self.selected?;
|
||||
|
||||
self.operations()
|
||||
|
Loading…
Reference in New Issue
Block a user