TAdvMemo MousetoCursor returns wrong coordinate

MousetoCursor function in TAdvMemo doesn't account for the scrolling offset when it calculate cursor coordinate from mouser position. If you scroll the editor down and call this function, it only returns coordinate from top left corner of the editor to current mouser pointer and it doesn't account for the number of rows/columns those have been scrolled.

Also, function Bookmakrs[nIndex] always returns -1 no matter what.

Could you please check and fix this problem.


We cannot change this interface as it would break existing applications using it.
To correct for the scroll position, add to the x cursor coordinate AdvMemo.LeftCol and to the y cursor coordinate Advmemo.TopRow