cocos2d / cocos2d-html5

Cocos2d for Web Browsers. Built using JavaScript.
https://www.cocos.com
3.07k stars 902 forks source link

cc.LayerColor incorrect behavior #2907

Closed metalim closed 9 years ago

metalim commented 9 years ago

cc.LayerColor draws it's rectangle as if it's anchor point was (0,0), not (0.5,0.5). That is: draws rectangle to top/right, instead of around it's center position.

pandamicro commented 9 years ago

on which platform ? Which engine version ?

metalim commented 9 years ago

cocos2d-html5 v3.6 Apologies. It seems to be behavior by design. :-( You can close the issue.

pandamicro commented 9 years ago

The anchor point is ignored in cc.Layer and its descendants:

https://github.com/cocos2d/cocos2d-html5/blob/develop/cocos2d/core/layers/CCLayer.js#L41

You can reactivate it with layer.ignoreAnchor = false;