refactored annotation panel height calculation