forked from 1b-agent/opencadstudio-upstream
fix: review fixes for the merged command-line, plugin and font changes
Direct distance entry (#1429) turned every bare number at a point prompt into a distance, so ROTATE's angle and the values automation types were read as coordinates. The step reads the token first now — `feed_command` reports whether it claimed it — and only an unclaimed one becomes a distance. That also puts the token back on the unified step driver, which owns the P / L selection keywords and the dimension-snap bookkeeping, and stops `on_text_input` running twice for the same token. A tracking ray carries its own base, so it no longer demands an anchor that the first point of a command does not have yet. Plugin command execution (#1425) re-implemented the command line inside the plugin host: it dispatched families directly, skipping the teardown that starts a command (grip edits, selection gestures, `last_point`, the accepted snaps), and made every `CmdResult::Dispatch` in the application skip plugin dispatch to avoid its own re-entrancy. A scripted line now runs through `run_command_line`, with the trailing Enter left off while the plugin streams the command, and the re-entrancy is handled by a flag set for the length of the plugin's call. A pause parks the line's Enter with the rest of its tokens instead of dropping it. A font reference (#1432) tried the family lookup before the face-file index, and that lookup ends in a prefix match a longer file name loses to (`ISOCPEUI.TTF` would take `ISOCP`). The exact file answers first. Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
1 parent
0cbaf18551
commit
fcbab57627
6 files changed
+94
-100
No files matched your search
+12
-11
@@ -876,28 +876,29 @@ pub(super) fn on_tab_close(&mut self, idx: usize) -> Task<Message> {
|
||||
/// direction in the active UCS plane.
|
||||
pub(in crate::app) fn try_direct_distance_entry(&mut self, text: &str) -> Option<Task<Message>> {
|
||||
let i = self.active_tab;
|
||||
let not_entity_pick = !self.tabs[i]
|
||||
if self.tabs[i]
|
||||
.active_cmd
|
||||
.as_ref()
|
||||
.map(|c| c.needs_entity_pick())
|
||||
.unwrap_or(false);
|
||||
if !not_entity_pick {
|
||||
.is_some_and(|c| c.needs_entity_pick())
|
||||
{
|
||||
return None;
|
||||
}
|
||||
|
||||
let anchor = self.tabs[i]
|
||||
.active_cmd
|
||||
.as_ref()
|
||||
.and_then(|c| c.resolved_anchor())
|
||||
.or(self.tabs[i].dyn_anchor)
|
||||
.or(self.last_point)?;
|
||||
|
||||
let dist = crate::entities::common::parse_length(text.trim())
|
||||
.or_else(|| crate::app::expr_eval::eval_number(text.trim()))?;
|
||||
|
||||
// A tracking ray carries its own base, so it needs no anchor: that is
|
||||
// how OTRACK and Extension accepted a bare distance for the *first*
|
||||
// point of a command, before any anchor exists.
|
||||
let pt = if let Some((base, dir)) = self.active_distance_ray(i) {
|
||||
base + dir * dist
|
||||
} else {
|
||||
let anchor = self.tabs[i]
|
||||
.active_cmd
|
||||
.as_ref()
|
||||
.and_then(|c| c.resolved_anchor())
|
||||
.or(self.tabs[i].dyn_anchor)
|
||||
.or(self.last_point)?;
|
||||
let w = self.tabs[i].last_cursor_world;
|
||||
let xf = self.tabs[i].ucs_xform();
|
||||
let d_ucs = xf.vec_to_ucs(w - anchor);
|
||||
|
||||
Reference in new issue
Block a user