示例#1
0
        /// <summary>
        /// Gets the distance to the left border of the text area of the specified visual column.
        /// The visual column must belong to the specified text line.
        /// </summary>
        public double GetTextLineVisualXPosition(TextLine textLine, int visualColumn)
        {
            if (textLine == null)
            {
                throw new ArgumentNullException(nameof(textLine));
            }
            var xPos = textLine.GetDistanceFromCharacter(
                Math.Min(visualColumn, VisualLengthWithEndOfLineMarker), 0);

            if (visualColumn > VisualLengthWithEndOfLineMarker)
            {
                xPos += (visualColumn - VisualLengthWithEndOfLineMarker) * _textView.WideSpaceWidth;
            }
            return(xPos);
        }