forked from 1b-agent/opencadstudio-upstream
feat(commands): step the selection-first text commands (bucket C)
Add SelectThenValueCommand (gather selection, then one value) and convert: - SelectThenValueCommand: HYPERLINK (url), ARCTEXT (text), TEXTFIT (width), SCALETEXT (factor), TCOUNT (start), TEXTMASK (Enter to apply). - SelectThenKeywordCommand: JUSTIFYTEXT (Left/Center/Right/Middle/Aligned/Fit), TCASE (Upper/Lower/Sentence/Title). Each bare form gathers a selection when none is set, prompts, and delegates to the inline handler. OBJECTSCALE already opens its dialog; TABLE CELL takes three values (row/col/text) and stays typeable — TABLE bare already builds a table interactively.
This commit is contained in:
1 parent
cf5362aeab
commit
208e617868
4 files changed
+185
-8
No files matched your search
@@ -1848,7 +1848,18 @@ impl OpenCADStudio {
|
||||
// ── SCALETEXT — rescale selected Text/MText entities ─────────────────
|
||||
// Usage: SCALETEXT <factor> e.g. SCALETEXT 2
|
||||
// SCALETEXT H <height> set absolute height
|
||||
cmd if cmd == "SCALETEXT" || cmd.starts_with("SCALETEXT ") => {
|
||||
"SCALETEXT" => {
|
||||
use crate::command::SelectThenValueCommand;
|
||||
let has_sel = !self.tabs[i].scene.selected_entities().is_empty();
|
||||
let c = SelectThenValueCommand::new(
|
||||
"SCALETEXT",
|
||||
"SCALETEXT scale factor (or 'H <height>' for an absolute height):",
|
||||
has_sel,
|
||||
);
|
||||
self.command_line.push_info(&c.prompt());
|
||||
self.tabs[i].active_cmd = Some(Box::new(c));
|
||||
}
|
||||
cmd if cmd.starts_with("SCALETEXT ") => {
|
||||
let rest = cmd.trim_start_matches("SCALETEXT").trim();
|
||||
let parts: Vec<&str> = rest.split_whitespace().collect();
|
||||
let selected_handles: Vec<acadrust::Handle> = self.tabs[i]
|
||||
|
||||
Reference in new issue
Block a user