Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/overlay_editor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ log = "0.4.22"
console_log = "^1.0.0"
console_error_panic_hook = "^0"

#i_mesh = "^0.4.0"
#i_triangle = { version = "^0.35.0", features = ["serde"] }
#i_mesh = "^0.5.0"
#i_triangle = { version = "^0.44.0", features = ["serde"] }

i_triangle = { path = "../../../../iShape/iTriangle/iTriangle", default-features = true, features = ["serde"] }
i_mesh = { path = "../../../../iShape/iMesh/iMesh" }
Expand Down
14 changes: 14 additions & 0 deletions examples/overlay_editor/src/app/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use crate::app::string::content::StringMessage;
use crate::app::string::content::StringState;
use crate::app::stroke::content::StrokeMessage;
use crate::app::stroke::content::StrokeState;
use crate::app::variable_stroke::content::{VariableStrokeMessage, VariableStrokeState};
use iced::keyboard::key::Named;
use iced::keyboard::Key;
use iced::widget::{rule, Space};
Expand All @@ -29,6 +30,7 @@ pub(super) struct MainState {
pub(super) boolean: BooleanState,
pub(super) string: StringState,
pub(super) stroke: StrokeState,
pub(super) variable_stroke: VariableStrokeState,
pub(super) outline: OutlineState,
}

Expand All @@ -37,6 +39,7 @@ pub(crate) enum MainAction {
Boolean,
String,
Stroke,
VariableStroke,
Outline,
}

Expand All @@ -46,6 +49,7 @@ impl MainAction {
MainAction::Boolean => "Boolean",
MainAction::String => "String",
MainAction::Stroke => "Stroke",
MainAction::VariableStroke => "Variable Stroke",
MainAction::Outline => "Outline",
}
}
Expand All @@ -62,6 +66,7 @@ pub(crate) enum AppMessage {
Bool(BooleanMessage),
String(StringMessage),
Stroke(StrokeMessage),
VariableStroke(VariableStrokeMessage),
Outline(OutlineMessage),
NextTest,
PrevTest,
Expand All @@ -74,13 +79,15 @@ impl EditorApp {
MainAction::Boolean,
MainAction::String,
MainAction::Stroke,
MainAction::VariableStroke,
MainAction::Outline,
],
state: MainState {
selected_action: MainAction::Boolean,
boolean: BooleanState::new(&mut app_resource.boolean),
string: StringState::new(&mut app_resource.string),
stroke: StrokeState::new(&mut app_resource.stroke),
variable_stroke: VariableStrokeState::new(&mut app_resource.variable_stroke),
outline: OutlineState::new(&mut app_resource.outline),
},
app_resource,
Expand All @@ -96,17 +103,20 @@ impl EditorApp {
AppMessage::Bool(msg) => self.boolean_update(msg),
AppMessage::String(msg) => self.string_update(msg),
AppMessage::Stroke(msg) => self.stroke_update(msg),
AppMessage::VariableStroke(msg) => self.variable_stroke_update(msg),
AppMessage::Outline(msg) => self.outline_update(msg),
AppMessage::NextTest => match self.state.selected_action {
MainAction::Boolean => self.boolean_next_test(),
MainAction::String => self.string_next_test(),
MainAction::Stroke => self.stroke_next_test(),
MainAction::VariableStroke => self.variable_stroke_next_test(),
MainAction::Outline => self.outline_next_test(),
},
AppMessage::PrevTest => match self.state.selected_action {
MainAction::Boolean => self.boolean_prev_test(),
MainAction::String => self.string_prev_test(),
MainAction::Stroke => self.stroke_prev_test(),
MainAction::VariableStroke => self.variable_stroke_prev_test(),
MainAction::Outline => self.outline_prev_test(),
},
}
Expand All @@ -133,6 +143,7 @@ impl EditorApp {
MainAction::Boolean => self.boolean_init(),
MainAction::String => self.string_init(),
MainAction::Stroke => self.stroke_init(),
MainAction::VariableStroke => self.variable_stroke_init(),
MainAction::Outline => self.outline_init(),
}
}
Expand All @@ -157,6 +168,9 @@ impl EditorApp {
MainAction::Stroke => content
.push(rule::vertical(1).style(style_separator))
.push(self.stroke_content()),
MainAction::VariableStroke => content
.push(rule::vertical(1).style(style_separator))
.push(self.variable_stroke_content()),
MainAction::Outline => content
.push(rule::vertical(1).style(style_separator))
.push(self.outline_content()),
Expand Down
1 change: 1 addition & 0 deletions examples/overlay_editor/src/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ mod outline;
mod solver_option;
mod string;
mod stroke;
mod variable_stroke;
Loading
Loading