mirror of
https://github.com/hannobraun/Fornjot
synced 2025-08-01 14:56:06 +00:00
Make name of struct more explicit
This commit is contained in:
parent
ca63735015
commit
091ebce436
@ -8,10 +8,10 @@ use winit::{
|
||||
window::{Window, WindowAttributes, WindowId},
|
||||
};
|
||||
|
||||
use crate::{geometry::OpsLog, render::Renderer, ui::OpsUi};
|
||||
use crate::{geometry::OpsLog, render::Renderer, ui::OperationView};
|
||||
|
||||
pub fn run(ops: OpsLog) -> anyhow::Result<()> {
|
||||
let mut ops = OpsUi {
|
||||
let mut ops = OperationView {
|
||||
ops_log: ops,
|
||||
selected: 0,
|
||||
};
|
||||
@ -31,7 +31,7 @@ pub fn run(ops: OpsLog) -> anyhow::Result<()> {
|
||||
}
|
||||
|
||||
struct App {
|
||||
ops: OpsUi,
|
||||
ops: OperationView,
|
||||
window: Option<Arc<Window>>,
|
||||
renderer: Option<Renderer>,
|
||||
pressed_keys: BTreeSet<Key>,
|
||||
|
@ -3,7 +3,7 @@ use std::sync::Arc;
|
||||
use anyhow::anyhow;
|
||||
use winit::window::Window;
|
||||
|
||||
use crate::ui::OpsUi;
|
||||
use crate::ui::OperationView;
|
||||
|
||||
use super::{geometry::Geometry, pipelines::Pipelines, text::TextRenderer};
|
||||
|
||||
@ -87,7 +87,7 @@ impl Renderer {
|
||||
})
|
||||
}
|
||||
|
||||
pub fn render(&mut self, operations: &OpsUi) -> anyhow::Result<()> {
|
||||
pub fn render(&mut self, operations: &OperationView) -> anyhow::Result<()> {
|
||||
let Some(selected_operation) = operations.selected() else {
|
||||
return Ok(());
|
||||
};
|
||||
|
@ -1,6 +1,6 @@
|
||||
use std::fmt::Write;
|
||||
|
||||
use crate::ui::OpsUi;
|
||||
use crate::ui::OperationView;
|
||||
|
||||
pub struct TextRenderer {
|
||||
text_atlas: glyphon::TextAtlas,
|
||||
@ -64,7 +64,7 @@ impl TextRenderer {
|
||||
|
||||
pub fn render(
|
||||
&mut self,
|
||||
operations: &OpsUi,
|
||||
operations: &OperationView,
|
||||
device: &wgpu::Device,
|
||||
queue: &wgpu::Queue,
|
||||
surface_config: &wgpu::SurfaceConfiguration,
|
||||
|
@ -1,11 +1,11 @@
|
||||
use crate::geometry::{Operation, OpsLog};
|
||||
|
||||
pub struct OpsUi {
|
||||
pub struct OperationView {
|
||||
pub ops_log: OpsLog,
|
||||
pub selected: usize,
|
||||
}
|
||||
|
||||
impl OpsUi {
|
||||
impl OperationView {
|
||||
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