Merge pull request #255 from dabingnn/v0.7_fix_rendering

should not drawImage if size zero
This commit is contained in:
Jare Guo
2016-01-15 16:05:53 +08:00
2 changed files with 10 additions and 6 deletions
@@ -398,9 +398,11 @@
wrapper.setFillStyle(context.createPattern(image, this._labelTexture._pattern));
context.fillRect(x, y, w, h);
} else {
context.drawImage(image,
sx, sy, sw, sh,
x, y, w, h);
if(sw !== 0 && sh !== 0 && w !== 0 && h !== 0) {
context.drawImage(image,
sx, sy, sw, sh,
x, y, w, h);
}
}
}
cc.g_NumberOfDraws = cc.g_NumberOfDraws + 1;
@@ -109,9 +109,11 @@
wrapper.setFillStyle(context.createPattern(image, this._textureToRender._pattern));
context.fillRect(x, y, w, h);
} else {
context.drawImage(image,
sx, sy, sw, sh,
x, y, w, h);
if(sw !== 0 && sh !== 0 && w !== 0 && h !== 0) {
context.drawImage(image,
sx, sy, sw, sh,
x, y, w, h);
}
}
}