Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tunni+speedvis+cut2 #393

Merged
merged 9 commits into from
Dec 13, 2023
Prev Previous commit
Next Next commit
Changes to the menu and tool bars to toggle new features. Icon for Cut.
  • Loading branch information
MatthewBlanchard authored and ctrlcctrlv committed Dec 13, 2023
commit 8f55336d631caeba23716831f99642690cf848ac
2 changes: 1 addition & 1 deletion src/user_interface/gui/icons/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pub use self::button::build as build_button;
pub use self::button::build_and_add as build_and_add_button;
pub use self::button::IntoResponse as IntoButtonResponse;

pub const _KNIFE: &str = "\u{F000}";
pub const KNIFE: &str = "\u{F000}";
pub const MEASURE: &str = "\u{F001}";
pub const PAN: &str = "\u{F002}";
pub const PEN: &str = "\u{F003}";
Expand Down
2 changes: 2 additions & 0 deletions src/user_interface/gui/menu_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ pub fn menu_bar(ctx: &Context, v: &mut Editor, i: &mut Interface, wm: &mut Windo
});

ui.checkbox(&mut i.grid.show, "Grid");
ui.checkbox(&mut i.curvature_vis, "Curvature Visualization");
ui.checkbox(&mut i.measure.enabled, "Show Measure");
});

//
Expand Down
1 change: 1 addition & 0 deletions src/user_interface/gui/tool_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ pub fn tool_bar(ctx: &Context, v: &mut Editor, _i: &mut Interface) {
build_button(v, ui, icons::PAN, ToolEnum::Pan);
build_button(v, ui, icons::SELECT, ToolEnum::Select);
build_button(v, ui, icons::PEN, ToolEnum::Pen);
build_button(v, ui, icons::KNIFE, ToolEnum::Cut);
ui.separator();
build_button(v, ui, icons::ZOOM, ToolEnum::Zoom);
build_button(v, ui, icons::MEASURE, ToolEnum::Measure);
Expand Down
5 changes: 5 additions & 0 deletions src/user_interface/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use skia_safe::Surface;

use crate::editor::Editor;
pub use crate::user_interface::mouse_input::MouseInfo;
pub use crate::render::measure::Measure;

use sdl2::{video::Window as SdlWindow, Sdl};

Expand All @@ -42,6 +43,8 @@ pub struct Interface {

pub context: Option<(f32, f32)>,
pub grid: Grid,
pub measure: Measure,
pub curvature_vis: bool,
pub mouse_info: MouseInfo,
pub viewport: Viewport,

Expand Down Expand Up @@ -84,6 +87,8 @@ impl Interface {

context: None,
grid: Grid::default(),
measure: Measure { start_point: None, end_point: None, enabled: true},
curvature_vis: true,
mouse_info: MouseInfo::default(),
viewport: Viewport::default(),

Expand Down