Make OperationView work with any operation

This commit is contained in:
Hanno Braun 2024-12-10 18:45:40 +01:00
parent 3f0a76aaf4
commit c4c139644e

View File

@ -1,14 +1,14 @@
use crate::geometry::{Operation, OpsLog};
use crate::geometry::Operation;
pub struct OperationView {
ops_log: OpsLog,
ops_log: Box<dyn Operation>,
selected: usize,
}
impl OperationView {
pub fn new(operation: OpsLog) -> Self {
pub fn new(operation: impl Operation + 'static) -> Self {
Self {
ops_log: operation,
ops_log: Box::new(operation),
selected: 0,
}
}