modify for better support of truncationTokenOffset and accuratet hittest