mirror of
https://github.com/hannobraun/Fornjot
synced 2025-07-31 22:36:11 +00:00
Add OperationView::new
This commit is contained in:
parent
091ebce436
commit
78f911b8d0
@ -11,10 +11,7 @@ use winit::{
|
||||
use crate::{geometry::OpsLog, render::Renderer, ui::OperationView};
|
||||
|
||||
pub fn run(ops: OpsLog) -> anyhow::Result<()> {
|
||||
let mut ops = OperationView {
|
||||
ops_log: ops,
|
||||
selected: 0,
|
||||
};
|
||||
let mut ops = OperationView::new(ops);
|
||||
ops.select_last();
|
||||
|
||||
let event_loop = EventLoop::new()?;
|
||||
|
@ -6,6 +6,13 @@ pub struct OperationView {
|
||||
}
|
||||
|
||||
impl OperationView {
|
||||
pub fn new(operation: OpsLog) -> Self {
|
||||
Self {
|
||||
ops_log: operation,
|
||||
selected: 0,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn select_last(&mut self) {
|
||||
self.selected = self.ops_log.operations.len().saturating_sub(1);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user