Skip to content

TfpgMemo CursorPosFromXY bug #90

@benohb

Description

@benohb

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;       

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions