public Collection <TF.TextBounds> GetNormalizedTextBounds(SnapshotSpan bufferSpan) { if (!IsValid) { throw new ObjectDisposedException(nameof(WpfTextViewLine)); } if (bufferSpan.Snapshot != Snapshot) { throw new ArgumentException(); } var span = ExtentIncludingLineBreak.Intersection(bufferSpan); var list = new List <TF.TextBounds>(); if (span == null) { return(new Collection <TF.TextBounds>(list)); } //TODO: Handle RTL text and adornments var startBounds = GetFirstTextBounds(span.Value.Start); var endBounds = GetLastTextBounds(span.Value.End); if (span.Value.End > End) { endBounds = new TF.TextBounds( endBounds.Trailing + EndOfLineWidth, endBounds.Top, 0, endBounds.Height, endBounds.TextTop, endBounds.TextHeight); } list.Add(new TF.TextBounds(startBounds.Left, startBounds.Top, endBounds.Left - startBounds.Left, startBounds.Height, startBounds.TextTop, startBounds.TextHeight)); return(new Collection <TF.TextBounds>(list)); }
/// <summary> /// Provides a hash function for <see cref="SourceTextLine"/>. /// </summary> public override int GetHashCode() { return(Line ^ ExtentIncludingLineBreak.GetHashCode()); }
public override string ToString() { return(ExtentIncludingLineBreak.ToString()); }
public bool ContainsBufferPosition(SnapshotPoint bufferPosition) => ExtentIncludingLineBreak.Contains(bufferPosition);
public string GetTextIncludingLineBreak() { return(ExtentIncludingLineBreak.GetText()); }