Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TfpgMemo CursorPosFromXY bug #90

Open
benohb opened this issue Feb 11, 2019 · 0 comments
Open

TfpgMemo CursorPosFromXY bug #90

benohb opened this issue Feb 11, 2019 · 0 comments

Comments

@benohb
Copy link

benohb commented Feb 11, 2019

If you click the mouse outside the text on the right (white space), ACursorPos variable will remain in its value from another line
The solution is to verify the search of result .If the mouse click is far from the text .The full length of the text will be taken

procedure TfpgMemo.CursorPosFromXY
....
+ inText:Boolean =false;
begin
...
    if abs(cx - x) < abs(cpx - x) then
    begin
      cpx := cx;
      cp  := n;
+ inText:=true;
    end;
  end;
...
+ if  inText then ACursorPos  := cp
+ else
+ ACursorPos:=UTF8Length(ls);

end;       
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant