Fixing the lastCursor calculation during resize.