Exemplo n.º 1
0
 public Collection <TextBounds> GetNormalizedTextBounds(SnapshotSpan bufferSpan)
 {
     if (bufferSpan.OverlapsWith(new Span(line.Offset, line.Length)))
     {
         double leading = 0;
         if (line.Contains(bufferSpan.Start))
         {
             leading = textEditor.LocationToPoint(textEditor.OffsetToLocation(bufferSpan.Start)).X;
         }
         var    endLoc = textEditor.OffsetToLocation(line.Contains(bufferSpan.End) ? bufferSpan.End : line.EndOffsetIncludingDelimiter);
         double endPos = textEditor.LocationToPoint(endLoc).X;
         return(new Collection <TextBounds>(new List <TextBounds>()
         {
             new TextBounds(leading, Top, endPos - leading, TextHeight, TextTop, TextHeight)
         }));
     }
     else
     {
         return(new Collection <TextBounds>());
     }
 }