This is good enough for now, though the sensorAngle bug (which is already filed) should probably include a better fix here.

Note, however, that without a comment, this just looks like an error since the comments says "screen height" and the code says window.innerWidth.  So this code is just asking to be changed and regressed. I'd suggest an explanatory comment.