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.