Adjust to 2.5 lines
This commit is contained in:
parent
2929a68de8
commit
eba4aafbfd
@ -759,8 +759,8 @@ core.prototype.animateBlock = function (loc,type,time,callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
////// 将某个块从禁用变成启用状态 //////
|
////// 将某个块从禁用变成启用状态 //////
|
||||||
core.prototype.showBlock = function(x, y, floodId) {
|
core.prototype.showBlock = function(x, y, floorId) {
|
||||||
core.maps.showBlock(x,y,floodId);
|
core.maps.showBlock(x,y,floorId);
|
||||||
}
|
}
|
||||||
|
|
||||||
////// 将某个块从启用变成禁用状态,但是并不删除它 //////
|
////// 将某个块从启用变成禁用状态,但是并不删除它 //////
|
||||||
|
|||||||
@ -403,6 +403,9 @@ ui.prototype.calTextBoxWidth = function (canvas, content, min_width, max_width)
|
|||||||
|
|
||||||
// 如果不存在手动换行,则二分自动换行
|
// 如果不存在手动换行,则二分自动换行
|
||||||
if (allLines.length == 1) {
|
if (allLines.length == 1) {
|
||||||
|
var w = core.canvas[canvas].measureText(allLines[0]).width;
|
||||||
|
return core.clamp(w / 2.4, min_width, max_width);
|
||||||
|
/*
|
||||||
var prefer_lines = 3;
|
var prefer_lines = 3;
|
||||||
var start = Math.floor(min_width), end = Math.floor(max_width);
|
var start = Math.floor(min_width), end = Math.floor(max_width);
|
||||||
while (start < end) {
|
while (start < end) {
|
||||||
@ -413,6 +416,7 @@ ui.prototype.calTextBoxWidth = function (canvas, content, min_width, max_width)
|
|||||||
start = mid + 1;
|
start = mid + 1;
|
||||||
}
|
}
|
||||||
return mid;
|
return mid;
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
// 存在手动换行:以最长的为准
|
// 存在手动换行:以最长的为准
|
||||||
else {
|
else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user