use bounding rect, thanks mgonto