fix(draw): build entities in the world XY plane, not a stale Y-up swap (#54)

The pick/typed point is the world XY plane (z = elevation = 0), but
several entity builders still mapped the screen point as if the world
were Y-up (drawing in XZ), reading the constant elevation as the DXF Y.
That collapsed shapes onto a single line — e.g. a revision cloud always
came out as two horizontal lines regardless of the path drawn.

Map the drawing-plane point straight through (x→x, y→y, z→elevation) in:
revcloud, donut, mline, raster image, wipeout (polygonal + rectangular),
table, attribute definition, and tolerance. Previews already used the
correct pass-through, so they matched the cursor; only the committed
geometry was wrong.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-06-04 10:18:12 +03:00
commit 3e493969b6
8 changed files with 14 additions and 14 deletions

View file

@ -146,7 +146,7 @@ impl CadCommand for MlineCommand {
fn build_mline(pts: &[Vec3], scale: f64, closed: bool, style_name: &str) -> EntityType {
let verts: Vec<Vector3> = pts
.iter()
.map(|p| Vector3::new(p.x as f64, p.z as f64, p.y as f64))
.map(|p| Vector3::new(p.x as f64, p.y as f64, p.z as f64))
.collect();
let mut mline = if closed {
MLine::closed_from_points(&verts)