fix(rect): merge current main

Preserve both Point and Rectangle property layouts where the two pull requests changed the same section.
This commit is contained in:
Hakan Seven committed 2026-08-22 23:03:26 +03:00
commit e74d5d78fc
98 files changed
+1167 -268

No files matched your search

+2
View File
@@ -220,6 +220,7 @@ impl CadCommand for AlignedDimensionCommand {
let p1 = p1.as_vec3();
let p2 = p2.as_vec3();
Some(WireModel {
point_marker: None,
taper_widths: Vec::new(),
world_width: 0.0,
depth_override: None,
@@ -278,6 +279,7 @@ fn preview_aligned(p1: DVec3, p2: DVec3, dim_pt: DVec3) -> WireModel {
let d1 = d1.as_vec3();
let d2 = d2.as_vec3();
WireModel {
point_marker: None,
taper_widths: Vec::new(),
world_width: 0.0,
depth_override: None,
+1
View File
@@ -161,6 +161,7 @@ fn v3(pt: DVec3) -> Vector3 {
fn preview_wire(points: Vec<Vec3>) -> WireModel {
WireModel {
point_marker: None,
taper_widths: Vec::new(),
world_width: 0.0,
depth_override: None,
+1
View File
@@ -192,6 +192,7 @@ fn v3(p: DVec3) -> Vector3 {
fn preview_line(a: Vec3, b: Vec3) -> WireModel {
WireModel {
point_marker: None,
taper_widths: Vec::new(),
world_width: 0.0,
depth_override: None,
+1
View File
@@ -180,6 +180,7 @@ impl CadCommand for DimBaselineCommand {
let dim_line_pt2 = dim_line_pt2.as_vec3();
let pt = pt.as_vec3();
Some(WireModel {
point_marker: None,
taper_widths: Vec::new(),
world_width: 0.0,
depth_override: None,
+1
View File
@@ -160,6 +160,7 @@ impl CadCommand for DimContinueCommand {
let dim_line_pt = p1 + perp * (dim_line_perp - p1.dot(perp));
let dim_line_pt2 = pt + perp * (dim_line_perp - pt.dot(perp));
Some(WireModel {
point_marker: None,
taper_widths: Vec::new(),
world_width: 0.0,
depth_override: None,
+1
View File
@@ -86,6 +86,7 @@ impl CadCommand for DimJogLineCommand {
}
let d = 0.3_f32;
Some(WireModel {
point_marker: None,
taper_widths: Vec::new(),
world_width: 0.0,
depth_override: None,
+1
View File
@@ -103,6 +103,7 @@ impl CadCommand for DimTeditCommand {
}
let d = 0.2_f32;
Some(WireModel {
point_marker: None,
taper_widths: Vec::new(),
world_width: 0.0,
depth_override: None,
+1
View File
@@ -300,6 +300,7 @@ fn preview_wire(pts: &[Vec3], arrow_size: f32) -> WireModel {
points.push([w2.x, w2.y, w2.z]);
}
WireModel {
point_marker: None,
taper_widths: Vec::new(),
world_width: 0.0,
depth_override: None,
+1
View File
@@ -237,6 +237,7 @@ fn v3(pt: DVec3) -> Vector3 {
fn preview_wire(points: Vec<DVec3>) -> WireModel {
WireModel {
point_marker: None,
taper_widths: Vec::new(),
world_width: 0.0,
depth_override: None,
+1
View File
@@ -227,6 +227,7 @@ fn preview_wire(pts: &[Vec3], arrow_size: f32) -> WireModel {
points.push([w2.x, w2.y, w2.z]);
}
WireModel {
point_marker: None,
taper_widths: Vec::new(),
world_width: 0.0,
depth_override: None,
+1
View File
@@ -462,6 +462,7 @@ impl CadCommand for MLeaderCollectCommand {
fn preview_wire(pts: &[Vec3]) -> WireModel {
WireModel {
point_marker: None,
taper_widths: Vec::new(),
world_width: 0.0,
depth_override: None,
+1
View File
@@ -137,6 +137,7 @@ fn ordinate_elbow(feature: DVec3, leader: DVec3, is_x: bool) -> DVec3 {
fn preview_wire(points: Vec<Vec3>) -> WireModel {
WireModel {
point_marker: None,
taper_widths: Vec::new(),
world_width: 0.0,
depth_override: None,
+1
View File
@@ -93,6 +93,7 @@ impl CadCommand for QdimCommand {
}
let d = 0.5_f32;
Some(WireModel {
point_marker: None,
taper_widths: Vec::new(),
world_width: 0.0,
depth_override: None,
+1
View File
@@ -197,6 +197,7 @@ fn v3(pt: DVec3) -> Vector3 {
fn preview_wire(points: Vec<Vec3>) -> WireModel {
WireModel {
point_marker: None,
taper_widths: Vec::new(),
world_width: 0.0,
depth_override: None,
+1
View File
@@ -199,6 +199,7 @@ impl CadCommand for TableCommand {
.map(|corner| self.plane.to_world(corner).as_vec3().to_array());
let [p0, p1, p2, p3] = corners;
Some(WireModel {
point_marker: None,
taper_widths: Vec::new(),
world_width: 0.0,
depth_override: None,
+1
View File
@@ -103,6 +103,7 @@ impl CadCommand for ToleranceCommand {
pt + self.plane.y * d,
];
Some(WireModel {
point_marker: None,
taper_widths: Vec::new(),
world_width: 0.0,
depth_override: None,
+1
View File
@@ -201,6 +201,7 @@ impl CadCommand for AttdefCommand {
pt + self.plane.y * d,
];
Some(WireModel {
point_marker: None,
taper_widths: Vec::new(),
world_width: 0.0,
depth_override: None,
+1
View File
@@ -181,6 +181,7 @@ impl CadCommand for MlineCommand {
.collect();
pts.push([pt.x, pt.y, pt.z]);
Some(WireModel {
point_marker: None,
taper_widths: Vec::new(),
world_width: 0.0,
depth_override: None,
+22 -8
View File
@@ -1,7 +1,7 @@
// Point tool — ribbon definition + interactive command.
//
// Command: POINT (PO)
// Single click → commits EntityType::Point. Stays active for more points.
// POINT commits one entity and exits. MULTIPOINT stays active.
use acadrust::types::Vector3;
use acadrust::{EntityType, Point as CadPoint};
@@ -22,25 +22,35 @@ pub fn tool() -> ToolDef {
}
}
pub struct PointCommand;
pub struct PointCommand {
multiple: bool,
}
impl PointCommand {
pub fn new() -> Self {
Self
Self { multiple: false }
}
pub fn multiple() -> Self {
Self { multiple: true }
}
}
impl CadCommand for PointCommand {
fn name(&self) -> &'static str {
"POINT"
if self.multiple { "MULTIPOINT" } else { "POINT" }
}
fn prompt(&self) -> String {
crate::t!("POINT Specify point:").into_owned()
}
fn options(&self) -> Vec<crate::command::CmdOption> {
use crate::command::CmdOption;
vec![CmdOption::enter(t!("Done").as_ref())]
if self.multiple {
use crate::command::CmdOption;
vec![CmdOption::enter(t!("Done").as_ref())]
} else {
Vec::new()
}
}
fn on_point(&mut self, pt: DVec3) -> CmdResult {
@@ -48,7 +58,11 @@ impl CadCommand for PointCommand {
location: Vector3::new(pt.x as f64, pt.y as f64, pt.z as f64),
..Default::default()
};
CmdResult::CommitEntity(EntityType::Point(p))
if self.multiple {
CmdResult::CommitEntity(EntityType::Point(p))
} else {
CmdResult::CommitAndExit(EntityType::Point(p))
}
}
fn on_enter(&mut self) -> CmdResult {
@@ -64,7 +78,7 @@ impl CadCommand for PointCommand {
// ── Autocomplete registry ─────────────────────────────────
inventory::submit!(crate::command::CommandRegistration { names: &["POINT"] }); // PointCommand
inventory::submit!(crate::command::CommandRegistration { names: &["POINT", "MULTIPOINT"] }); // PointCommand
// Point display style system variables + dialog.
inventory::submit!(crate::command::CommandRegistration {
names: &["PDMODE", "PDSIZE", "DDPTYPE"]
+1
View File
@@ -123,6 +123,7 @@ impl CadCommand for ImageCommand {
let [p0, p1, p2, p3] = corners;
Some(WireModel {
point_marker: None,
taper_widths: Vec::new(),
world_width: 0.0,
depth_override: None,
+2
View File
@@ -85,6 +85,7 @@ impl CadCommand for RayCommand {
let dir = (pt - base).normalize_or_zero();
let far = base + dir * DISPLAY_EXTENT;
Some(WireModel {
point_marker: None,
taper_widths: Vec::new(),
world_width: 0.0,
depth_override: None,
@@ -187,6 +188,7 @@ impl CadCommand for XLineCommand {
let far_pos = base + dir * DISPLAY_EXTENT;
let far_neg = base - dir * DISPLAY_EXTENT;
Some(WireModel {
point_marker: None,
taper_widths: Vec::new(),
world_width: 0.0,
depth_override: None,
+1
View File
@@ -362,6 +362,7 @@ impl CadCommand for AreaCommand {
points.push(to_render(point));
points.push(to_render(self.points[0]));
Some(WireModel {
point_marker: None,
taper_widths: Vec::new(),
world_width: 0.0,
depth_override: None,
+1
View File
@@ -85,6 +85,7 @@ impl CadCommand for DistCommand {
let p1 = self.first?;
// The preview wire is purely visual, so f32 vertices are fine here.
Some(WireModel {
point_marker: None,
taper_widths: Vec::new(),
world_width: 0.0,
depth_override: None,
+1
View File
@@ -70,6 +70,7 @@ impl MeasureGeomCommand {
/// Build a cyan preview wire connecting the picked points and the cursor.
fn preview_wire(name: &str, pts: Vec<[f32; 3]>) -> WireModel {
WireModel {
point_marker: None,
taper_widths: Vec::new(),
world_width: 0.0,
depth_override: None,
+1
View File
@@ -3719,6 +3719,7 @@ fn collect_runs(pts: &[[f64; 2]], take: &dyn Fn([f64; 2]) -> bool, out: &mut Vec
/// Build a preview wire from a NaN-break point list.
fn preview_wire(points: Vec<[f32; 3]>, color: [f32; 4], name: &str) -> WireModel {
WireModel {
point_marker: None,
taper_widths: Vec::new(),
world_width: 0.0,
depth_override: None,
+1
View File
@@ -511,6 +511,7 @@ inventory::submit!(crate::command::CommandRegistration {
fn wire(name: &str, points: Vec<[f32; 3]>) -> WireModel {
WireModel {
point_marker: None,
taper_widths: Vec::new(),
world_width: 0.0,
depth_override: None,
+1
View File
@@ -54,6 +54,7 @@ impl CadCommand for PlotWindowCommand {
let p1 = self.p1?.as_vec3();
// Draw the selection rectangle.
Some(WireModel {
point_marker: None,
taper_widths: Vec::new(),
world_width: 0.0,
depth_override: None,
+1
View File
@@ -136,6 +136,7 @@ impl CadCommand for ZoomWindowCommand {
let max = p1.max(pt);
// Draw a rectangle preview
Some(WireModel {
point_marker: None,
taper_widths: Vec::new(),
world_width: 0.0,
depth_override: None,