Use _getTopOffset to calculate top cursor boundary

Left cursor boundary is calculated with _getLeftOffset,
top cursor boundary should also be calculated with the corresponding offset method
Merge pull request #1604 from sorich87/hotfix/top-cursor-boundary-calculation

Use _getTopOffset to calculate top cursor boundary