public static FillableShape2D ToFillableShape(IShape2D shape, bool filled) { FillableShape2D fillableShape2D = shape as FillableShape2D; if (fillableShape2D == null) { return(new FillableShape2D(shape, filled)); } if (fillableShape2D.Filled != filled) { return(new FillableShape2D(fillableShape2D.ishape2D_0, filled)); } return(fillableShape2D); }
internal void method_0(DxfModel model) { if ((this.elementType_0 & DxfLineType.ElementType.IsShape) != DxfLineType.ElementType.None) { if (this.TextStyle == null) { return; } ShxFile shxFile = this.TextStyle.GetShxFile(); if (shxFile == null) { return; } ShxShape shapeByIndex = shxFile.GetShapeByIndex((ushort)this.short_0); if (shapeByIndex == null) { return; } WW.Math.Point2D endPoint; this.fillableShape2D_0 = new FillableShape2D(shapeByIndex.GetGlyphShape(this.TextStyle.IsVertical, out endPoint), false); } else { if ((this.elementType_0 & DxfLineType.ElementType.IsText) == DxfLineType.ElementType.None || this.TextStyle == null) { return; } Class425 class425 = Class594.smethod_10(this.string_0, 1.0, this.TextStyle.ObliqueAngle, this.TextStyle.WidthFactor, this.TextStyle, Colors.White); List <Class908> class908List = new List <Class908>(); class425.imethod_3((ICollection <Class908>)class908List, Matrix4D.Identity, (short)0); GeneralShape2D generalShape2D = new GeneralShape2D(); bool filled = false; foreach (Class908 class908 in class908List) { generalShape2D.Append(class908.FontPath, false); if (class908.Font.Filled) { filled = true; } } if (!generalShape2D.HasSegments) { return; } generalShape2D.ShrinkWrap(); this.fillableShape2D_0 = new FillableShape2D((IShape2D) new CachedBoundsShape2D((IShape2D)generalShape2D), filled); } }