[fix] adjust tooltip position when intersecting with window boundaries