Projects > cpp > Issues > Bug #3459

We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.

Create Issue on Github

Cocos2dxBitmap.java的createTextBitmap可能引起宕机

Bug #3459 [Closed]
ppme 2013-12-20 07:41 . Updated about 10 years ago

final TextProperty textProperty = Cocos2dxBitmap.computeTextProperty(pString, pWidth, pHeight, paint);
final int bitmapTotalHeight = (pHeight == 0 ? textProperty.mTotalHeight: pHeight);

当pHeight为0时,textProperty.mTotalHeight可能也为0,这个时候Bitmap.createBitmap创建就是出错。使得Java_org_cocos2dx_lib_Cocos2dxBitmap_nativeInitBitmapDC回调时,转换共享内存中的数据为图片时宕机。

ppme 2013-12-20 07:47

是部分编码字符会引起,使得textProperty.mTotalHeight里面计算的高度还是为0,个人处理是出现这种情况时,就默认生成1像素的空白底图。这样就不会宕机了,看下是否有时间查下修复下这个问题。谢谢~

walzer@cocos2d-x.org 2014-10-08 02:47

Redmine issue system is closed, we are using github issue system instead.

This issue was moved to https://github.com/cocos2d/cocos2d-x/issues/8287

Atom PDF

Status:Closed
Start date:2013-12-20
Priority:Low
Due date:
Assignee:-
% Done:

0%

Category:-
Target version:-