Vec2, Rect and Size could be inited by null

This commit is contained in:
Huabing.Xu
2015-12-23 14:44:09 +08:00
parent 5d08023906
commit faf22b30d6
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ var JS = require('../platform/js');
* @param {Number} [h=0]
*/
function Rect (x, y, w, h) {
if (typeof x === 'object') {
if (x && typeof x === 'object') {
y = x.y;
w = x.width;
h = x.height;
+1 -1
View File
@@ -10,7 +10,7 @@ var JS = require('../platform/js');
* @see cc.size
*/
function Size (width, height) {
if (typeof width === 'object') {
if (width && typeof width === 'object') {
height = width.height;
width = width.width;
}
+1 -1
View File
@@ -18,7 +18,7 @@ var FireClass = require('../platform/CCClass');
* @param {number} [y=0]
*/
function Vec2 (x, y) {
if (typeof x === 'object') {
if (x && typeof x === 'object') {
y = x.y;
x = x.x;
}