Skip to content

Commit d03af93

Browse files
committed
Some small corrections
1 parent e2445ac commit d03af93

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Diff for: cocos2d/core/sprites/CCSpriteCanvasRenderCmd.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
w = locWidth * scaleX;
150150
h = locHeight * scaleY;
151151

152-
if (texture) {
152+
if (texture && texture._htmlElementObj) {
153153
image = texture._htmlElementObj;
154154
if (texture._pattern !== "") {
155155
wrapper.setFillStyle(context.createPattern(image, texture._pattern));

Diff for: cocos2d/core/utils/CCProfiler.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,17 @@ cc.profiler = (function () {
124124
this.init();
125125
}
126126

127-
cc.container.appendChild(_fps);
127+
if (_fps.parentElement === null) {
128+
cc.container.appendChild(_fps);
129+
}
128130
_showFPS = true;
129131
},
130132

131133
hideStats: function () {
132134
_showFPS = false;
133-
cc.container.removeChild(_fps);
135+
if (_fps.parentElement === cc.container) {
136+
cc.container.removeChild(_fps);
137+
}
134138
},
135139

136140
init: function () {

0 commit comments

Comments
 (0)