fix(resize): fix shrink resize not working in flex-box by clearing before getting width
fix(resize): fix shrink resize not working in flex-box by clearing before getting width

the container may have retained its old width in the flex layout because the canvas wasn't cleared yet.

opensheetmusicdisplay/opensheetmusicdisplay,opensheetmusicdisplay/opensheetmusicdisplay,opensheetmusicdisplay/opensheetmusicdisplay