protected override void DrawSpecific(PicGraphics graphics) { // get text size graphics.GetTextSize(Text, PicGraphics.TextType.FT_COTATION, GlobalCotationProperties.FontSize, out double textWidth, out double textHeight); // offset points GetOffsetPoints(out Vector2D pt2, out Vector2D pt3); // find out if is middle quotation bool middle = IsMiddleQuotation(pt2, pt3, textWidth, textHeight); if (!middle && (!GlobalCotationProperties._showDeportedCotations || Auto)) { return; } // draw extremity segments if (UseShortLines || PicGlobalCotationProperties.ShowShortCotationLines) { double arrowLength = graphics.DX_inv(GlobalCotationProperties.ArrowLength); Vector2D vecI = _pt0 - pt2; vecI.Normalize(); vecI *= arrowLength; graphics.DrawLine(LineType, pt2 + vecI, pt2 - vecI); graphics.DrawLine(LineType, pt3 + vecI, pt3 - vecI); } else { graphics.DrawLine(LineType, _pt0, pt2); graphics.DrawLine(LineType, _pt1, pt3); } // draw arrow line DrawArrowLine(graphics, pt2, pt3, textWidth, textHeight, out Vector2D ptText, out middle); // draw text graphics.DrawText(Text, PicGraphics.TextType.FT_COTATION, GlobalCotationProperties.FontSize, ptText, PicGraphics.HAlignment.HA_CENTER, PicGraphics.VAlignment.VA_MIDDLE, TextDirection); // draw arrows heads DrawArrowHead(graphics, pt2, (middle ? 1.0 : -1.0) * (pt2 - pt3)); DrawArrowHead(graphics, pt3, (middle ? 1.0 : -1.0) * (pt3 - pt2)); }
protected override void DrawSpecific(PicGraphics graphics, Transform2D transform) { float fontSize = (Math.Abs(FontSize) < 0.1f) ? PicCotation.GlobalCotationProperties.FontSize : graphics.FontSizePt(FontSize); graphics.DrawText(Text, PicGraphics.TextType.FT_COTATION, fontSize, Point + graphics.OffsetFont(FontSize, VAlignment), HAlignment, VAlignment, TextDirection); }