Menu

#1971 Clicking in margin to select line doesn't work if content is scrolled

Bug
closed-fixed
5
2017-10-25
2017-09-11
No

Open a document that contains at least a couple pages worth of content (I verified this problem exists with the ScintillaTest app). Without scrolling the content, click in an insensitive margin anywhere on the page and its whole line is selected as expected. Now scroll the content past the first page and click in the margin. The first click does nothing, the second click selects first word or all of the whitespace up to the first non-whitespace character. The third click selects the whole line, the next click repeats the cycle by unselecting the line.

This bug has existed for a while and is not new to any version of macOS. My guess is that the problem is with Editor::PointInSelMargin() and that the coordinates need to be translated.

Discussion

  • Neil Hodgson

    Neil Hodgson - 2017-09-12
    • status: open --> open-accepted
    • assigned_to: Neil Hodgson
     
  • Neil Hodgson

    Neil Hodgson - 2017-09-12

    OK, this seems to work:

    diff -r d62863ae40a3 src/Editor.cxx
    --- a/src/Editor.cxx    Mon Sep 11 09:05:35 2017 +1000
    +++ b/src/Editor.cxx    Tue Sep 12 18:11:32 2017 +1000
    @@ -4320,6 +4320,8 @@
            PRectangle rcSelMargin = GetClientRectangle();
            rcSelMargin.right = static_cast<XYPOSITION>(vs.textStart - vs.leftMarginWidth);
            rcSelMargin.left = static_cast<XYPOSITION>(vs.textStart - vs.fixedColumnWidth);
    +       const Point ptOrigin = GetVisibleOriginInMain();
    +       rcSelMargin.Move(0, -ptOrigin.y);
            return rcSelMargin.ContainsWholePixel(pt);
        } else {
            return false;
    
     
  • Chinh Nguyen

    Chinh Nguyen - 2017-09-12

    Yes, that fixed it. Thanks.

     
  • Neil Hodgson

    Neil Hodgson - 2017-09-13
    • status: open-accepted --> open-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2017-09-13

    Committed as [96506c].

     

    Related

    Commit: [96506c]

  • Neil Hodgson

    Neil Hodgson - 2017-10-25
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.