public Bounds2D GetBounds(Enum24 whiteSpaceHandling, Class985 resultLayoutInfo) { Bounds2D bounds = this.Settings.Font.Metrics.GetBounds(this.Text, whiteSpaceHandling); if (resultLayoutInfo != null) { double y = bounds.Min.Y; if (y < 0.0) { if ((resultLayoutInfo.BoundsCalculationFlags & Enum36.flag_1) != Enum36.flag_0) { bounds.Min = new Point2D(bounds.Min.X, 0.0); } if (y < resultLayoutInfo.TextBlockDescent) { resultLayoutInfo.TextBlockDescent = y; } } } if (bounds.Max.Y > this.class596_0.Height) { bounds.Max = new Point2D(bounds.Max.X, this.class596_0.Height); } bounds.Move(this.vector2D_0.X, this.vector2D_0.Y); return(bounds); }
public override Bounds2D GetBounds(Enum24 whiteSpaceHandling, Class985 resultLayoutInfo) { Bounds2D bounds = base.GetBounds(whiteSpaceHandling, resultLayoutInfo); bounds.Update((Point2D)this.Offset); return(bounds); }
internal static IList <Class908> smethod_3( DxfMText mtext, Color color, short lineWeight, Matrix4D insertionTransformation, Class985 mtextLayoutInfo) { return(Class666.smethod_1(mtext.Text, mtext.ReferenceRectangleWidth, mtext.Height, mtext.AttachmentPoint, mtext.LineSpacingFactor, mtext.LineSpacingStyle, mtext.Style, mtext.Style.WidthFactor, color, mtext.DrawingDirection, lineWeight, insertionTransformation * mtext.Transform, mtextLayoutInfo, Enum24.flag_3)); }
public virtual Bounds2D GetBounds(Enum24 whiteSpaceHandling, Class985 resultLayoutInfo) { Bounds2D bounds2D = new Bounds2D(); foreach (Interface24 nterface24 in this.linkedList_0) { bounds2D.Update(nterface24.GetBounds(whiteSpaceHandling, resultLayoutInfo)); } return(bounds2D); }
public Bounds2D GetBounds(Enum24 whiteSpaceHandling, Class985 resultLayoutInfo) { Bounds2D bounds2D = new Bounds2D(); bool flag = true; foreach (Class425 class425 in this.linkedList_0) { Bounds2D bounds = class425.GetBounds(whiteSpaceHandling, resultLayoutInfo); if ((whiteSpaceHandling & Enum24.flag_1) != Enum24.flag_0) { if (this.class1024_0.ParagraphWidth != 0.0) { bounds.Min = new Point2D(this.vector2D_0.X, bounds.Min.Y); } else { double leftIndent = this.class1024_0.LeftIndent; if (flag) { flag = false; leftIndent += this.class1024_0.LeftIndentFirst; } bounds.Min -= new Vector2D(leftIndent, 0.0); if (bounds.Min.X > bounds.Max.X) { bounds.Max = new Point2D(bounds.Min.X, bounds.Max.Y); } } } if ((whiteSpaceHandling & Enum24.flag_2) != Enum24.flag_0 && this.class1024_0.ParagraphWidth != 0.0) { bounds.Max = new Point2D(this.vector2D_0.X + this.class1024_0.ParagraphWidth, bounds.Max.Y); } if (resultLayoutInfo != null) { if (resultLayoutInfo.FirstLineBounds == null) { resultLayoutInfo.FirstLineBounds = bounds; resultLayoutInfo.FirstLineDescent = resultLayoutInfo.TextBlockDescent; } resultLayoutInfo.LastLineBounds = bounds; resultLayoutInfo.LastLineDescent = resultLayoutInfo.TextBlockDescent; resultLayoutInfo.TextBlockDescent = 0.0; } bounds2D.Update(bounds); } if ((whiteSpaceHandling & Enum24.flag_2) != Enum24.flag_0) { bounds2D.Update(bounds2D.Max + new Vector2D(this.class1024_0.RightIndent, 0.0)); } return(bounds2D); }
internal static IList <Class908> smethod_0( string text, double height, DxfTextStyle style, double widthFactor, Color color, short lineWeight, Matrix4D insertionTransformation, Class985 resultLayoutInfo, Enum24 whiteSpaceHandlingFlags) { return(Class666.smethod_1(text, 0.0, height, AttachmentPoint.MiddleLeft, 1.0, LineSpacingStyle.Exact, style, widthFactor, color, DrawingDirection.LeftToRight, lineWeight, insertionTransformation, resultLayoutInfo, whiteSpaceHandlingFlags)); }
internal static IList <Class908> smethod_4( DxfMText mtext, Color color, short lineWeight, Matrix4D insertionTransformation, Bounds2D collectBounds) { Class985 resultLayoutInfo = collectBounds == null ? (Class985)null : new Class985(); IList <Class908> class908List = Class666.smethod_1(mtext.Text, mtext.ReferenceRectangleWidth, mtext.Height, mtext.AttachmentPoint, mtext.LineSpacingFactor, mtext.LineSpacingStyle, mtext.Style, mtext.Style.WidthFactor, color, mtext.DrawingDirection, lineWeight, insertionTransformation * mtext.Transform, resultLayoutInfo, Enum24.flag_3); collectBounds?.Update(resultLayoutInfo.Bounds); return(class908List); }
public override Bounds2D GetBounds(Enum24 whiteSpaceHandling, Class985 resultLayoutInfo) { Bounds2D bounds = base.GetBounds(whiteSpaceHandling, resultLayoutInfo); if (!bounds.Initialized) { bounds.Update(this.Offset.X, this.Offset.Y); bounds.Update(this.Offset.X, this.Offset.Y + this.Settings.Height); } else { bounds.Update(bounds.Min.X, this.Offset.Y); bounds.Update(bounds.Min.X, this.Offset.Y + this.Settings.Height); } return(bounds); }
internal static IList <Class908> smethod_1( string text, double width, double height, AttachmentPoint attachmentPoint, double lineSpacingFactor, LineSpacingStyle lineSpacingStyle, DxfTextStyle style, double widthFactor, Color color, DrawingDirection drawingDirection, short lineWeight, Matrix4D insertionTransformation, Class985 resultLayoutInfo, Enum24 whiteSpaceHandlingFlags) { Class1023[] class1023Array = Class594.smethod_12(text, width, height, attachmentPoint, lineSpacingFactor, lineSpacingStyle, style, widthFactor, color, drawingDirection); Vector2D zero = Vector2D.Zero; IList <Class908> class908List = (IList <Class908>) new List <Class908>(); Bounds2D bounds = new Bounds2D(); foreach (Class1023 class1023 in class1023Array) { class1023.imethod_0(ref zero, class1023.Settings.Height, whiteSpaceHandlingFlags); bounds.Update(class1023.GetBounds(whiteSpaceHandlingFlags, resultLayoutInfo)); } double num1 = 0.0; double num2 = 0.0; if (bounds.Initialized) { switch (attachmentPoint) { case AttachmentPoint.TopLeft: num1 = -bounds.Corner1.X; num2 = -bounds.Corner2.Y; break; case AttachmentPoint.TopCenter: num1 = -bounds.Center.X; num2 = -bounds.Corner2.Y; break; case AttachmentPoint.TopRight: num1 = -bounds.Corner2.X; num2 = -bounds.Corner2.Y; break; case AttachmentPoint.MiddleLeft: num1 = -bounds.Corner1.X; num2 = -bounds.Center.Y; break; case AttachmentPoint.MiddleCenter: num1 = -bounds.Center.X; num2 = -bounds.Center.Y; break; case AttachmentPoint.MiddleRight: num1 = -bounds.Corner2.X; num2 = -bounds.Center.Y; break; case AttachmentPoint.BottomLeft: num1 = -bounds.Corner1.X; num2 = -bounds.Corner1.Y; break; case AttachmentPoint.BottomCenter: num1 = -bounds.Center.X; num2 = -bounds.Corner1.Y; break; case AttachmentPoint.BottomRight: num1 = -bounds.Corner2.X; num2 = -bounds.Corner1.Y; break; } } if (width == 0.0) { num1 = 0.0; } Vector2D vector2D = new Vector2D(num1, num2); foreach (Class1023 class1023 in class1023Array) { class1023.Offset += vector2D; class1023.imethod_3((ICollection <Class908>)class908List, insertionTransformation, lineWeight); } if (resultLayoutInfo != null) { bounds.Move(num1, num2); resultLayoutInfo.Bounds.Update(bounds); if (resultLayoutInfo.FirstLineBounds != null) { resultLayoutInfo.FirstLineBounds.Move(num1, num2); } if (resultLayoutInfo.LastLineBounds != null && resultLayoutInfo.LastLineBounds != resultLayoutInfo.FirstLineBounds) { resultLayoutInfo.LastLineBounds.Move(num1, num2); } } return(class908List); }