mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-06 11:31:59 +08:00
Fix typo
This commit is contained in:
@@ -417,7 +417,7 @@ module.exports = {
|
||||
|
||||
_measureText (ctx) {
|
||||
return function (string) {
|
||||
return TextUtils.measureText(ctx, string);
|
||||
return TextUtils.safeMeasureText(ctx, string);
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
@@ -227,7 +227,7 @@ var TextUtils = {
|
||||
return ((ch >= 9 && ch <= 13) || ch === 32 || ch === 133 || ch === 160 || ch === 5760 || (ch >= 8192 && ch <= 8202) || ch === 8232 || ch === 8233 || ch === 8239 || ch === 8287 || ch === 12288);
|
||||
},
|
||||
|
||||
safeMeasureText = function (ctx, string) {
|
||||
safeMeasureText: function (ctx, string) {
|
||||
var metric = ctx.measureText(string);
|
||||
return metric && metric.width || 0;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user