fix(properties): normalize XLine direction edits
This commit is contained in:
parent
74c1fe48d8
commit
5bd104faab
1 changed files with 11 additions and 8 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue