Fixed: IE8/9 (maybe 10 too) can't handle negative width or height.

Functions are used everywhere to set width or height in the DOM except in the method lockFocus. This will cause IE8/9 to report error if the width or height is negative in this method.