At some point you calculate the size of the object you draw as you have to know where to draw. Simply store that size in a member variable and return it from within sizeHint. The matrix you use will help you to do the calculations.