我正在创建一个自定义形状,确切地说是一个六边形。我将它们绘制在一个中心点周围,如下所示:
PathSegmentCollection segmentCollection = new PathSegmentCollection();
segmentCollection.Add(new LineSegment() { Point = new Point(x + tileXDelta / 2, y + tileRadius / 2) }); // 1
segmentCollection.Add(new LineSegment() { Point = new Point(x + tileXDelta / 2, y-tileRadius / 2) }); // 2
segmentCollection.Add(new LineSegment() { Point = new Point(x + 0, y-tileRadius) }); // 3
segmentCollection.Add(new LineSegment() { Point = new Point(x-tileXDelta / 2, y-tileRadius / 2) }); // 4
segmentCollection.Add(new LineSegment() { Point = new Point(x - tileXDelta / 2, y + tileRadius / 2) }); // 5
segmentCollection.Add(new LineSegment() { Point = new Point(x + 0, y + tileRadius) }); // 6
segmentCollection.Add(new LineSegment() { Point = new Point(x + tileXDelta / 2, y + tileRadius / 2) }); // 7
结果是:
这里的问题是它从中心位置到第一个角画了一条线。有没有办法可以跳过那条线?