修复滑冰和多行文本绘制
This commit is contained in:
parent
b25029ec72
commit
472bc4fc58
@ -867,7 +867,7 @@ ui.prototype.drawTextContent = function (ctx, content, config) {
|
||||
config.index = 0;
|
||||
config.currcolor = config.color;
|
||||
config.currfont = config.fontSize;
|
||||
config.lineMargin = Math.max(0, config.lineHeight - config.fontSize);
|
||||
config.lineMargin = Math.max(Math.round(config.fontSize / 4), config.lineHeight - config.fontSize);
|
||||
config.topMargin = parseInt(config.lineMargin / 2);
|
||||
config.lineMaxHeight = config.lineMargin + config.fontSize;
|
||||
config.offsetX = 0;
|
||||
|
||||
@ -161,6 +161,10 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 =
|
||||
"type": "comment",
|
||||
"text": "公共事件:滑冰事件"
|
||||
},
|
||||
{
|
||||
"type": "if",
|
||||
"condition": "core.getBgNumber() == 167",
|
||||
"true": [
|
||||
{
|
||||
"type": "if",
|
||||
"condition": "core.canMoveHero()",
|
||||
@ -226,21 +230,15 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 =
|
||||
"type": "comment",
|
||||
"text": "如果该点不存在事件,则继续检测该点是否是滑冰点"
|
||||
},
|
||||
{
|
||||
"type": "if",
|
||||
"condition": "core.getBgNumber() == 167",
|
||||
"true": [
|
||||
{
|
||||
"type": "function",
|
||||
"function": "function(){\ncore.insertAction(\"滑冰事件\",null,null,null,true)\n}"
|
||||
}
|
||||
],
|
||||
"false": []
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"false": []
|
||||
]
|
||||
}
|
||||
],
|
||||
"回收钥匙商店": [
|
||||
|
||||
@ -181,7 +181,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
||||
var text = core.material.items[item.id].text || "该道具暂无描述";
|
||||
try { text = core.replaceText(text); } catch (e) {}
|
||||
for (var fontSize = 20; fontSize >= 8; fontSize -= 2) {
|
||||
var config = { left: 10, fontSize: fontSize, maxWidth: 403, lineHeight: 1.4 };
|
||||
var config = { left: 10, fontSize: fontSize, maxWidth: 403 };
|
||||
var height = core.getTextContentHeight(text, config);
|
||||
if (height <= 50) {
|
||||
config.top = (56 - height) / 2;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user