Browse Source

Fixed SD2-547: Incorrect text line selected after scrolling text editor window

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@711 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 20 years ago
parent
commit
cba44d45b9
  1. 4
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextView.cs

4
src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextView.cs

@ -723,8 +723,8 @@ namespace ICSharpCode.TextEditor @@ -723,8 +723,8 @@ namespace ICSharpCode.TextEditor
/// </summary>
public int GetLogicalLine(Point mousepos)
{
int physicalLine = FirstPhysicalLine + (int)(mousepos.Y / FontHeight);
return Document.GetFirstLogicalLine(physicalLine);
int clickedVisualLine = Math.Max(0, (mousepos.Y + this.textArea.VirtualTop.Y) / fontHeight);
return Document.GetFirstLogicalLine(clickedVisualLine);
}
public Point GetLogicalColumn(int firstLogicalLine, int xPos)

Loading…
Cancel
Save