fix: preserve part rotation through lead-in assign/remove cycle
Track preLeadInRotation when parts are rotated so lead-in removal can restore the correct rotation. Remove stale HasManualLeadIns and LeadInsLocked deserialization from NestReader since these flags are transient state, not persisted data. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -106,6 +106,7 @@ namespace OpenNest
|
|||||||
EnsureOwnedProgram();
|
EnsureOwnedProgram();
|
||||||
Program.Rotate(angle);
|
Program.Rotate(angle);
|
||||||
location = Location.Rotate(angle);
|
location = Location.Rotate(angle);
|
||||||
|
preLeadInRotation = Program.Rotation;
|
||||||
UpdateBounds();
|
UpdateBounds();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,6 +120,7 @@ namespace OpenNest
|
|||||||
EnsureOwnedProgram();
|
EnsureOwnedProgram();
|
||||||
Program.Rotate(angle);
|
Program.Rotate(angle);
|
||||||
location = Location.Rotate(angle, origin);
|
location = Location.Rotate(angle, origin);
|
||||||
|
preLeadInRotation = Program.Rotation;
|
||||||
UpdateBounds();
|
UpdateBounds();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -214,8 +214,6 @@ namespace OpenNest.IO
|
|||||||
var part = new Part(dwg);
|
var part = new Part(dwg);
|
||||||
part.Rotate(partDto.Rotation);
|
part.Rotate(partDto.Rotation);
|
||||||
part.Offset(new Vector(partDto.X, partDto.Y));
|
part.Offset(new Vector(partDto.X, partDto.Y));
|
||||||
part.HasManualLeadIns = partDto.HasManualLeadIns;
|
|
||||||
part.LeadInsLocked = partDto.LeadInsLocked;
|
|
||||||
plate.Parts.Add(part);
|
plate.Parts.Add(part);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user