make sure invalidate size is called after visibility toggle