forked from 1b-agent/opencadstudio-upstream
fix(properties): normalize XLine direction edits
This commit is contained in:
1 parent
74c1fe48d8
commit
5bd104faab
1 file changed
+11
-8
+11
-8
@@ -267,14 +267,17 @@ impl PropertyEditable for XLine {
|
||||
self.set_direction(direction);
|
||||
}
|
||||
}
|
||||
"xl_dx" => {
|
||||
self.direction.x = v;
|
||||
}
|
||||
"xl_dy" => {
|
||||
self.direction.y = v;
|
||||
}
|
||||
"xl_dz" => {
|
||||
self.direction.z = v;
|
||||
"xl_dx" | "xl_dy" | "xl_dz" => {
|
||||
let mut direction = self.direction;
|
||||
match field {
|
||||
"xl_dx" => direction.x = v,
|
||||
"xl_dy" => direction.y = v,
|
||||
"xl_dz" => direction.z = v,
|
||||
_ => unreachable!(),
|
||||
}
|
||||
if direction.length_squared() > 1e-18 {
|
||||
self.set_direction(direction);
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user