Canvas size dynamic change in flexbox layout