Browse Source

dxf: Fix to alignment of Inserts

Kenric Nugteren 3 months ago
parent
commit
7bd2fc60dd
1 changed files with 2 additions and 0 deletions
  1. 2 0
      inabox.dxf/Objects.cs

+ 2 - 0
inabox.dxf/Objects.cs

@@ -69,6 +69,7 @@ internal class DxfInsert : IDxfObject
         data.ArbitraryAxis(Insert.Normal);
         data.Rotate((float)Insert.Rotation);
         data.Scale((float)Insert.Scale.X, (float)Insert.Scale.Y);
+        data.Translate(new PointF(-(float)Insert.Block.Origin.X, -(float)Insert.Block.Origin.Y));
 
         data.PushBlockColour(Insert.Color, Insert);
 
@@ -103,6 +104,7 @@ internal class DxfInsert : IDxfObject
         data.ArbitraryAxis(Insert.Normal);
         data.Rotate((float)Insert.Rotation);
         data.Scale((float)Insert.Scale.X, (float)Insert.Scale.Y);
+        data.Translate(new PointF(-(float)Insert.Block.Origin.X, -(float)Insert.Block.Origin.Y));
 
         var bounds = Utils.CombineBounds(Objects.Select(x => x.GetBounds(data)));