public ArgbColor GetPlotColor(DxfEntity entity) { if (this.graphicsConfig_0.PlotStyleManager == null) { return(entity.GetColor(this)); } return(this.graphicsConfig_0.PlotStyleManager((IPlotPropertyOwner)entity, this).Color); }
public void CreateMText(DxfMText text, DrawContext.Wireframe drawContext) { if (text.Text == null || text.Text.Trim() == string.Empty) { return; } Bounds2D collectBounds = new Bounds2D(); IList <Class908> chunks = Class666.smethod_4(text, text.Color.ToColor(), drawContext.GetLineWeight((DxfEntity)text), drawContext.GetTransformer().Matrix, collectBounds); BackgroundFillFlags backgroundFillFlags = text.BackgroundFillFlags; BackgroundFillInfo backgroundFillInfo = text.BackgroundFillInfo; if (backgroundFillFlags == BackgroundFillFlags.UseBackgroundFillColor && backgroundFillInfo != null) { System.Drawing.Color color = (System.Drawing.Color)DxfEntity.GetColor(this.graphicsConfig_0.IndexedColors, backgroundFillInfo.Color, drawContext.ByBlockColor, drawContext.ByBlockDxfColor, text.GetLayer((DrawContext)drawContext)); double num1 = text.Height * (backgroundFillInfo.BorderOffsetFactor - 1.0); double x1 = collectBounds.Center.X; double y1 = collectBounds.Center.Y; double width = text.Width; double y2 = collectBounds.Delta.Y; double num2; double num3; switch (text.AttachmentPoint) { case AttachmentPoint.TopLeft: num2 = collectBounds.Corner1.X + 0.5 * width; num3 = collectBounds.Corner2.Y - 0.5 * y2; break; case AttachmentPoint.TopCenter: num2 = collectBounds.Center.X; num3 = collectBounds.Corner2.Y - 0.5 * y2; break; case AttachmentPoint.TopRight: num2 = collectBounds.Corner2.X - 0.5 * width; num3 = collectBounds.Corner2.Y - 0.5 * y2; break; case AttachmentPoint.MiddleLeft: num2 = collectBounds.Corner1.X + 0.5 * width; num3 = collectBounds.Center.Y; break; case AttachmentPoint.MiddleCenter: num2 = collectBounds.Center.X; num3 = collectBounds.Center.Y; break; case AttachmentPoint.MiddleRight: num2 = collectBounds.Corner2.X - 0.5 * width; num3 = collectBounds.Center.Y; break; case AttachmentPoint.BottomLeft: num2 = collectBounds.Corner1.X + 0.5 * width; num3 = collectBounds.Corner1.Y + 0.5 * y2; break; case AttachmentPoint.BottomCenter: num2 = collectBounds.Center.X; num3 = collectBounds.Corner1.Y + 0.5 * y2; break; case AttachmentPoint.BottomRight: num2 = collectBounds.Corner2.X - 0.5 * width; num3 = collectBounds.Corner1.Y + 0.5 * y2; break; default: num2 = collectBounds.Center.X; num3 = collectBounds.Center.Y; break; } short lineWeight = drawContext.GetLineWeight((DxfEntity)text); Matrix4D matrix4D = drawContext.GetTransformer().Matrix *text.Transform; WW.Math.Point2D point = new WW.Math.Point2D(num2 - 0.5 * width - num1, num3 - 0.5 * y2 - num1); double x2 = width + 2.0 * num1; double y3 = y2 + 2.0 * num1; this.method_4(false, (Interface12) new Class341((ArgbColor)color, (Interface23) new Class535(true, new Vector4D[4] { matrix4D.TransformTo4D(point), matrix4D.TransformTo4D(point + new Vector2D(x2, 0.0)), matrix4D.TransformTo4D(point + new Vector2D(x2, y3)), matrix4D.TransformTo4D(point + new Vector2D(0.0, y3)) }), true, lineWeight)); } this.method_3(chunks, (DxfEntity)text, drawContext); }