adapt legend box to account for polygon outline (#4105)