Exemple #1
0
 int GetFirstColumn(SnapshotPoint point)
 {
     if (point.Snapshot != Snapshot)
     {
         throw new ArgumentException();
     }
     return(FilterColumn(linePartsCollection.ConvertBufferPositionToColumn(point)));
 }
        TF.TextBounds GetTextBounds(SnapshotPoint point)
        {
            if (point.Snapshot != Snapshot)
            {
                throw new ArgumentException();
            }
            int col = linePartsCollection.ConvertBufferPositionToColumn(point);

            if (col == endColumn)
            {
                return(new TF.TextBounds(TextRight, Top, 0, Height, TextTop, TextHeight));
            }
            double start = TextLine.GetDistanceFromCharacterHit(new CharacterHit(col, 0));
            double end   = TextLine.GetDistanceFromCharacterHit(new CharacterHit(col, 1));
            double extra = TextLeft;

            Debug.Assert(textLines.Count == 1);
            return(new TF.TextBounds(extra + start, Top, end - start, Height, TextTop, TextHeight));
        }