forked from 1b-agent/opencadstudio-upstream
feat(view): zoom-window ribbon button and bare ZOOM command
Bare `ZOOM` had no dispatch arm — only the sub-keyword forms (ZOOM EXTENTS/IN/OUT/WINDOW/…) were handled, so typing `ZOOM` fell through to an unknown-command error. It now starts the interactive window zoom. Add the missing Zoom Window ribbon button: the command existed but had no tool()/icon, so it was reachable only by typing. Wire it into View ▸ Navigate with a new dashed-rectangle magnifier icon. Closes #210 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
ccd249d40f
commit
9928cbf0e5
4 files changed
+24
-1
No files matched your search
@@ -60,6 +60,7 @@ impl CadModule for ViewModule {
|
||||
title: "Navigate",
|
||||
tools: vec![
|
||||
RibbonItem::LargeTool(zoom_ext::tool()),
|
||||
RibbonItem::Tool(zoom_window::tool()),
|
||||
RibbonItem::Tool(zoom_in::tool()),
|
||||
RibbonItem::Tool(zoom_out::tool()),
|
||||
RibbonItem::Tool(pan::tool()),
|
||||
|
||||
@@ -3,8 +3,22 @@
|
||||
use glam::{DVec3, Vec3};
|
||||
|
||||
use crate::command::{CadCommand, CmdResult};
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
use crate::scene::model::wire_model::WireModel;
|
||||
|
||||
pub const ICON: IconKind =
|
||||
IconKind::Svg(include_bytes!("../../../assets/icons/zoom_window.svg"));
|
||||
|
||||
/// Ribbon button: zoom into a rectangle picked by two corners.
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef {
|
||||
id: "ZOOM_WINDOW",
|
||||
label: "Zoom Window",
|
||||
icon: ICON,
|
||||
event: ModuleEvent::Command("ZOOM WINDOW".to_string()),
|
||||
}
|
||||
}
|
||||
|
||||
pub struct ZoomWindowCommand {
|
||||
first: Option<Vec3>,
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user