Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fireball-x/fireball#454: Fix issues in JS bindings #29

Merged
merged 1 commit into from
Dec 10, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cocos2d/core/components/CCSpriteRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ var SpriteRenderer = cc.Class({
if (initialized === false) {
return;
}
this._sprite = this._sgNode._scale9Image;
this._sprite = this._sgNode.getSprite();
},

/**
Expand Down Expand Up @@ -452,7 +452,7 @@ var SpriteRenderer = cc.Class({
var node = node || this._sgNode;
if (this._useOriginalSize) {
var rect = this._sprite.getRect();
node.setPreferredSize(rect.size);
node.setPreferredSize(cc.size(rect.width, rect.height));
}
else {
node.setPreferredSize(this.node.getContentSize(true));
Expand Down
2 changes: 1 addition & 1 deletion cocos2d/core/platform/deserialize.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ var _Deserializer = (function () {
obj = new klass();
}

if (obj instanceof CCObject && obj._deserialize) {
if (obj._deserialize) {
obj._deserialize(serialized.content, self);
return obj;
}
Expand Down
2 changes: 1 addition & 1 deletion cocos2d/core/value-types/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ require('./CCSize');
require('./CCRect');
require('./CCColor');
require('./CCTypes');
require('./CCAffineTransform')
require('./CCAffineTransform');
require('./CCTypesWebGL');
10 changes: 4 additions & 6 deletions gulp/tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,15 +191,13 @@ function rebundle_jsb(bundler, minify, suffix) {
}

gulp.task('build-jsb-extends-min', function () {
var jsbExtends = rebundle_jsb(createBundler(paths.JSBEntryExtends), true, '_extends');
var jsbPredefine = rebundle_jsb(createBundler(paths.JSBEntryPredefine), true, '_predefine');
return es.merge(jsbExtends, jsbPredefine);
var jsbPolyfill = rebundle_jsb(createBundler(paths.JSBEntries), true, '_polyfill');
return jsbPolyfill;
});

gulp.task('build-jsb-extends-dev', function () {
var jsbExtends = rebundle_jsb(createBundler(paths.JSBEntryExtends), false, '_extends');
var jsbPredefine = rebundle_jsb(createBundler(paths.JSBEntryPredefine), false, '_predefine');
return es.merge(jsbExtends, jsbPredefine);
var jsbPolyfill = rebundle_jsb(createBundler(paths.JSBEntries), false, '_polyfill');
return jsbPolyfill;
});


Expand Down
9 changes: 5 additions & 4 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ MinifyOriginCocos2d = false; // true - compile by closure, false - just conc
paths = {
src: './src',
jsEntry: './index.js',
//JSBEntryPredefine: './gulp/jsb-build-entry-predefine',
//JSBEntryExtends: './gulp/jsb-build-entry-extends',
JSBEntryPredefine: './jsb_predefine.js',
JSBEntryExtends: './extends.js',
JSBEntries: [
'./jsb_predefine.js',
'../editor/static/build-templates/runtime/jsb_polyfill.js',
'./extends.js'
],
outDir: './bin',
outFile: 'cocos2d-js.js',
JSBOutFile: 'jsb.js',
Expand Down