forked from 1b-agent/opencadstudio-upstream
STRETCH: arcs keep their height; splines stretch; real preview
An arc moved only when its centre was in the window, so stretching a rounded end left the arc where it was or blew it up. Its ends now decide: both in move it, one in moves that end while the arc keeps its height (sagitta) over the new chord. Polyline arc segments keep their height the same way instead of their bulge, spline control and fit points in the window move, and 3D polylines and points stretch too. Old-style polylines were tested in X/Z. The preview moved the tessellated points that happened to be in the window, which bent arcs out of shape; it now draws the stretched entities through one shared function the commit also uses, via a new preview_entities hook, and hides the originals while it shows. Closes #1851 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
519d6605f9
commit
907fa8d760
6 files changed
+372
-288
No files matched your search
@@ -2974,6 +2974,13 @@ pub trait CadCommand: Send {
|
||||
self.on_preview_wires(pt)
|
||||
}
|
||||
|
||||
/// Entities the host draws as the live preview, tessellated like the
|
||||
/// drawing's own (arcs, text, linetypes and all). Commands whose preview
|
||||
/// changes an entity's shape return edited copies of it here.
|
||||
fn preview_entities(&mut self, _document: &codec::CadDocument, _pt: DVec3) -> Vec<EntityType> {
|
||||
Vec::new()
|
||||
}
|
||||
|
||||
/// Source entities replaced by the current live preview. The host removes
|
||||
/// these from the resident render until the command commits or cancels.
|
||||
/// Commands such as COPY keep their sources visible and use the default.
|
||||
|
||||
Reference in new issue
Block a user