fix richtext custom chinese font rendering issue

This commit is contained in:
zilongshanren
2016-12-07 15:22:36 +08:00
parent 0663649451
commit 3354816e87
+6 -1
View File
@@ -346,10 +346,15 @@ var RichText = cc.Class({
this._sgNode.addChild(labelSegment);
this._labelSegments.push(labelSegment);
//when lineHeight is less than the content size of labelSize
//in Web platform, the extra pixels will be trimed.
//so we need to set the overflow to clamp in JSB
//FIXME: label in jsb should be refactored to keep the behavior the same as web platform.
if(CC_JSB) {
labelSegment.setOverflow(1);
var size = labelSegment.getContentSize();
labelSegment.setContentSize(size.width, this.lineHeight);
labelSegment.enableWrap(false);
labelSegment.setDimensions(size.width, this.lineHeight);
}
return labelSegment;