resolve issue #1242: reverse order of init and doMath so that viewport i...

...s initialized when determining width