Explorar o código

dxf: Fix to alignment of Inserts

Kenric Nugteren hai 5 meses
pai
achega
7bd2fc60dd
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  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)));