feat: port p-rec-annot ortho viewport maintenance foundation

This commit is contained in:
codex
2026-08-07 12:43:08 +03:00
parent ba39a649be
commit 7d8cc570df
8 changed files with 116 additions and 6 deletions
@@ -49,6 +49,16 @@ internal sealed class LineConnectionAnnotationWriter
attribute.LayerId = layers[assets.TextLayer]; attribute.TextStyleId = styles[assets.TextStyle];
attribute.UpdateMTextAttribute(); reference.AttributeCollection.AppendAttribute(attribute); transaction.AddNewlyCreatedDBObject(attribute, true);
}
if (plan.ConnectorPosition is { } connector)
{
using var leader = new Polyline(3) { LayerId = layers[assets.PolylineLayer], XData = Ownership(viewportStableId, plan) };
leader.AddVertexAt(0, new Point2d(connector.X, connector.Y), 0, 0, 0);
// Legacy PXP-ALC uses an orthogonal two-segment leader. Its
// elbow shares the annotation Y coordinate for a stable route.
leader.AddVertexAt(1, new Point2d(connector.X, plan.Position.Y), 0, 0, 0);
leader.AddVertexAt(2, new Point2d(plan.Position.X, plan.Position.Y), 0, 0, 0);
paper.AppendEntity(leader); transaction.AddNewlyCreatedDBObject(leader, true);
}
}
transaction.Commit();
return new(deleted, insertable.Length);