CCRects converted with jsb does not create origin/size properties#4010
CCRects converted with jsb does not create origin/size properties#4010luisparravicini wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Hi @luisparravicini ,
We should not delete x, y, width, height directly and use origin, size . That will break the compatibility of JSB.
Do you have any ideas about keep the compatibility?
There was a problem hiding this comment.
Keeping x/y/height/width and adding size/origin would be exactly like what getBoundingBox() returns in js.
The thing is, (maybe because this is my first attempt at modifying cocos2d and not knowing the inner workings of it) but I don't really know why a ccrect in this case is not using size/origin.
Can you take a look at my last note on http://www.cocos2d-x.org/issues/3065#note-3 ?
Thanks
There was a problem hiding this comment.
From the API point of view, I think it is simpler to use x, y, width, height directly.
Although origin and size are correct, the user has to type more.
So, instead of fixing CCRect and I would fix the return value getBoundingBox()
I do not know if that can be done automatically with the bindings... if the return value is CCRect, then return x,y,width,height.
There was a problem hiding this comment.
Sorry I'm doing too many questions: if CCRects (when used through jsb) have to return x, y, width, height, which is what's happening now (not taking into account this pr), why not leave getBoundingBox() as is but change in js cc._RectApplyAffineTransformIn to just don't return origin and size? That's what made me create the issue and this patch in the first place (unless such a change in the API is unacceptable).
There was a problem hiding this comment.
Thanks Luis.
Tomorrow I'll review our code... I'll give you a detailed answer tomorrow.
There was a problem hiding this comment.
I added this bug report about regarding this:
http://www.cocos2d-x.org/issues/3260
|
Do not change API of cocos2dx in all language. |
|
Dear luisparravicini: |
When using javascript through jsb, a call to getBoundingBox() returns an object with properties x/y/height/width and not origin/size properties.
Submitted as issue 3065
cocos2d-js-tests pull request: 231