Make sure layer thumbnail's size is calculated using the projection itself
We shouldn't use layer->extent() for the thumbnail generation, because
extent may also include indirect painting device, which may have a
different size, not like the one of projection (e.g. when selection is
active).
CCBUG:394439