public static ITextViewLine GetSpecViewLine(ITextView tv, int offset, TriBezierLines tbl) { if (tv == null) { return null; } ITextViewLineCollection tvlc; try { tvlc = tv.TextViewLines; } catch (InvalidOperationException) { return null; } if (tvlc == null) return null; //quite important, not applicable now int colSize = tvlc.Count; offset -= 1; //strange here, a bug double theight = tv.ViewportHeight / 2.0; try { double lineHeight = tvlc.GetTextViewLineContainingYCoordinate(theight).Height; double midoffset = lineHeight * offset * (TriBezierLines.Mid - tbl); return tvlc.GetTextViewLineContainingYCoordinate(theight - midoffset); } catch (System.Exception) { return null; } }
public BezierLine(TriBezierLines tbl) { myPath = new Path(); tblType = tbl; }