fix(io): map DXF text vertical alignment for correct rendering

TextEntity import was only mapping HorizontalAlignment to CadText,
leaving VAlign at its default (Near/top). Middle-center text rendered
shifted to the bottom instead of vertically centered.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-23 07:17:47 -04:00
parent f064368008
commit 86582d28c3
+8
View File
@@ -839,6 +839,13 @@ namespace OpenNest.Forms
ACadSharp.Entities.TextHorizontalAlignment.Right => System.Drawing.StringAlignment.Far,
_ => System.Drawing.StringAlignment.Near,
};
var va = text.VerticalAlignment switch
{
ACadSharp.Entities.TextVerticalAlignmentType.Middle => System.Drawing.StringAlignment.Center,
ACadSharp.Entities.TextVerticalAlignmentType.Top => System.Drawing.StringAlignment.Near,
ACadSharp.Entities.TextVerticalAlignmentType.Bottom => System.Drawing.StringAlignment.Far,
_ => System.Drawing.StringAlignment.Far,
};
texts.Add(new CadText
{
Position = new Vector(pt.X, pt.Y),
@@ -847,6 +854,7 @@ namespace OpenNest.Forms
Rotation = text.Rotation,
LayerName = text.Layer?.Name,
HAlign = ha,
VAlign = va,
});
break;
}