avoid drawing when view is not visible