|
@@ -105,6 +105,13 @@ let JpcCanvasOutput = {
|
|
|
if (rst.length === 0) rst.push(''); //什么都没有,也得整个空串
|
|
|
return rst;
|
|
|
}
|
|
|
+ function _chkIfShinkFirst(control, actLines) {
|
|
|
+ let rst = false;
|
|
|
+ if (control.ShrinkFirst === 'T' && control.Wrap !== 'T' && actLines > 1) {
|
|
|
+ rst = true;
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ }
|
|
|
function private_drawText(val, area, font, control) {
|
|
|
let dftFontHeight = 12;
|
|
|
let output = [];
|
|
@@ -207,7 +214,8 @@ let JpcCanvasOutput = {
|
|
|
let lines = Math.floor((area[JV.IDX_BOTTOM] - area[JV.IDX_TOP]) / (dftFontHeight + JV.OUTPUT_OFFSET[JV.OFFSET_IDX_BOTTOM] + JV.OUTPUT_OFFSET[JV.OFFSET_IDX_TOP] + 4));
|
|
|
lines = (lines === 0 || (control.Shrink === 'T' && control.ShrinkFirst === 'T'))?1:lines;
|
|
|
let actLines = private_splitString(val, validAreaTxtWidth, ctx);
|
|
|
- if (actLines.length > lines && dftFontHeight >= 6) {
|
|
|
+ // if (actLines.length > lines && dftFontHeight >= 6) {
|
|
|
+ if ((actLines.length > lines || _chkIfShinkFirst(control, actLines.length)) && dftFontHeight >= 6) {
|
|
|
dftFontHeight--;
|
|
|
ctx.font = "" + dftFontHeight + "px " + font[JV.PROP_NAME];
|
|
|
} else {
|