@visactor/vrender 0.21.0-alpha.10 → 0.21.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/dist/index.es.js +37 -19
- package/dist/index.js +37 -19
- package/dist/index.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +3 -3
package/cjs/index.d.ts
CHANGED
package/cjs/index.js
CHANGED
|
@@ -21,7 +21,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
21
21
|
|
|
22
22
|
const vrender_core_1 = require("@visactor/vrender-core"), vrender_kits_1 = require("@visactor/vrender-kits"), vrender_kits_2 = require("@visactor/vrender-kits");
|
|
23
23
|
|
|
24
|
-
exports.version = "0.21.0-alpha.
|
|
24
|
+
exports.version = "0.21.0-alpha.11", (0, vrender_core_1.preLoadAllModule)(), (0,
|
|
25
25
|
vrender_core_1.isBrowserEnv)() ? (0, vrender_kits_1.loadBrowserEnv)(vrender_core_1.container) : (0,
|
|
26
26
|
vrender_core_1.isNodeEnv)() && (0, vrender_kits_1.loadNodeEnv)(vrender_core_1.container),
|
|
27
27
|
(0, vrender_kits_2.registerArc)(), (0, vrender_kits_2.registerArc3d)(), (0, vrender_kits_2.registerArea)(),
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,iBAAiB,CAAC;AAEzC,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAI,IAAA,2BAAY,GAAE,EAAE;IAClB,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;CAC3B;KAAM,IAAI,IAAA,wBAAS,GAAE,EAAE;IACtB,IAAA,0BAAW,EAAC,wBAAS,CAAC,CAAC;CACxB;AACD,IAAA,0BAAW,GAAE,CAAC;AACd,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,8BAAe,GAAE,CAAC;AAClB,IAAA,gCAAiB,GAAE,CAAC;AACpB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,iCAAkB,GAAE,CAAC;AACrB,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,4CAA6B,GAAE,CAAC;AAChC,IAAA,0CAA2B,GAAE,CAAC;AAC9B,IAAA,2CAA4B,GAAE,CAAC;AAC/B,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,kCAAmB,GAAE,CAAC;AACtB,yDAAuC;AACvC,yDAAuC","file":"index.js","sourcesContent":["import '@visactor/vrender-core';\nimport {\n container,\n isBrowserEnv,\n isNodeEnv,\n preLoadAllModule,\n registerFlexLayoutPlugin,\n registerViewTransform3dPlugin,\n registerHtmlAttributePlugin,\n registerReactAttributePlugin,\n registerDirectionalLight,\n registerOrthoCamera\n} from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv } from '@visactor/vrender-kits';\nimport {\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\n// 导出版本号\nexport const version = \"0.21.0-alpha.
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,iBAAiB,CAAC;AAEzC,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAI,IAAA,2BAAY,GAAE,EAAE;IAClB,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;CAC3B;KAAM,IAAI,IAAA,wBAAS,GAAE,EAAE;IACtB,IAAA,0BAAW,EAAC,wBAAS,CAAC,CAAC;CACxB;AACD,IAAA,0BAAW,GAAE,CAAC;AACd,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,8BAAe,GAAE,CAAC;AAClB,IAAA,gCAAiB,GAAE,CAAC;AACpB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,iCAAkB,GAAE,CAAC;AACrB,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,4CAA6B,GAAE,CAAC;AAChC,IAAA,0CAA2B,GAAE,CAAC;AAC9B,IAAA,2CAA4B,GAAE,CAAC;AAC/B,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,kCAAmB,GAAE,CAAC;AACtB,yDAAuC;AACvC,yDAAuC","file":"index.js","sourcesContent":["import '@visactor/vrender-core';\nimport {\n container,\n isBrowserEnv,\n isNodeEnv,\n preLoadAllModule,\n registerFlexLayoutPlugin,\n registerViewTransform3dPlugin,\n registerHtmlAttributePlugin,\n registerReactAttributePlugin,\n registerDirectionalLight,\n registerOrthoCamera\n} from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv } from '@visactor/vrender-kits';\nimport {\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\n// 导出版本号\nexport const version = \"0.21.0-alpha.11\";\n\npreLoadAllModule();\n\nif (isBrowserEnv()) {\n loadBrowserEnv(container);\n} else if (isNodeEnv()) {\n loadNodeEnv(container);\n}\nregisterArc();\nregisterArc3d();\nregisterArea();\nregisterCircle();\nregisterGlyph();\nregisterGroup();\nregisterImage();\nregisterLine();\nregisterPath();\nregisterPolygon();\nregisterPyramid3d();\nregisterRect();\nregisterRect3d();\nregisterRichtext();\nregisterShadowRoot();\nregisterSymbol();\nregisterText();\nregisterWrapText();\n\nregisterFlexLayoutPlugin();\nregisterViewTransform3dPlugin();\nregisterHtmlAttributePlugin();\nregisterReactAttributePlugin();\nregisterDirectionalLight();\nregisterOrthoCamera();\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\n"]}
|
package/dist/index.es.js
CHANGED
|
@@ -3951,7 +3951,8 @@ const DefaultTextStyle = {
|
|
|
3951
3951
|
underlineDash: [],
|
|
3952
3952
|
underlineOffset: 0,
|
|
3953
3953
|
disableAutoClipedPoptip: void 0,
|
|
3954
|
-
measureMode: MeasureModeEnum.fontBounding
|
|
3954
|
+
measureMode: MeasureModeEnum.fontBounding,
|
|
3955
|
+
keepCenterInLine: !1
|
|
3955
3956
|
};
|
|
3956
3957
|
const DefaultPickStyle = {
|
|
3957
3958
|
pickStrokeBuffer: 0
|
|
@@ -14619,7 +14620,8 @@ class CanvasTextLayout {
|
|
|
14619
14620
|
const {
|
|
14620
14621
|
lineWidth: lineWidth,
|
|
14621
14622
|
suffixPosition = "end",
|
|
14622
|
-
measureMode = MeasureModeEnum.actualBounding
|
|
14623
|
+
measureMode = MeasureModeEnum.actualBounding,
|
|
14624
|
+
keepCenterInLine = !1
|
|
14623
14625
|
} = null != params ? params : {};
|
|
14624
14626
|
lines = lines.map(l => l.toString());
|
|
14625
14627
|
const linesLayout = [],
|
|
@@ -14632,7 +14634,8 @@ class CanvasTextLayout {
|
|
|
14632
14634
|
str: metrics.width <= lineWidth ? lines[i].toString() : this.textMeasure.clipTextWithSuffix(lines[i], this.textOptions, width, suffix, wordBreak, suffixPosition).str,
|
|
14633
14635
|
width: width,
|
|
14634
14636
|
ascent: metrics.ascent,
|
|
14635
|
-
descent: metrics.descent
|
|
14637
|
+
descent: metrics.descent,
|
|
14638
|
+
keepCenterInLine: keepCenterInLine
|
|
14636
14639
|
});
|
|
14637
14640
|
}
|
|
14638
14641
|
bboxWH[0] = lineWidth;
|
|
@@ -14647,7 +14650,8 @@ class CanvasTextLayout {
|
|
|
14647
14650
|
str: text,
|
|
14648
14651
|
width: width,
|
|
14649
14652
|
ascent: metrics.ascent,
|
|
14650
|
-
descent: metrics.descent
|
|
14653
|
+
descent: metrics.descent,
|
|
14654
|
+
keepCenterInLine: keepCenterInLine
|
|
14651
14655
|
});
|
|
14652
14656
|
}
|
|
14653
14657
|
bboxWH[0] = _lineWidth;
|
|
@@ -14678,9 +14682,12 @@ class CanvasTextLayout {
|
|
|
14678
14682
|
};
|
|
14679
14683
|
}
|
|
14680
14684
|
lineOffset(bbox, line, textAlign, textBaseline, lineHeight, origin) {
|
|
14681
|
-
"left" === textAlign || "start" === textAlign ? line.leftOffset = 0 : "center" === textAlign ? line.leftOffset = (bbox.width - line.width) / 2 : "right" !== textAlign && "end" !== textAlign || (line.leftOffset = bbox.width - line.width), line.topOffset = lineHeight / 2 + (line.ascent - line.descent) / 2 + origin[1]
|
|
14682
|
-
|
|
14683
|
-
|
|
14685
|
+
if ("left" === textAlign || "start" === textAlign ? line.leftOffset = 0 : "center" === textAlign ? line.leftOffset = (bbox.width - line.width) / 2 : "right" !== textAlign && "end" !== textAlign || (line.leftOffset = bbox.width - line.width), line.topOffset = lineHeight / 2 + (line.ascent - line.descent) / 2 + origin[1], !line.keepCenterInLine) {
|
|
14686
|
+
const buf = 0,
|
|
14687
|
+
actualHeightWithBuf = line.ascent + line.descent + buf;
|
|
14688
|
+
actualHeightWithBuf < lineHeight - buf && ("bottom" === textBaseline ? line.topOffset += (lineHeight - actualHeightWithBuf) / 2 : "top" === textBaseline && (line.topOffset -= (lineHeight - actualHeightWithBuf) / 2));
|
|
14689
|
+
}
|
|
14690
|
+
return origin[1] += lineHeight, line;
|
|
14684
14691
|
}
|
|
14685
14692
|
}
|
|
14686
14693
|
|
|
@@ -14831,7 +14838,8 @@ class Text extends Graphic {
|
|
|
14831
14838
|
lineWidth = textTheme.lineWidth,
|
|
14832
14839
|
whiteSpace = textTheme.whiteSpace,
|
|
14833
14840
|
suffixPosition = textTheme.suffixPosition,
|
|
14834
|
-
ignoreBuf = textTheme.ignoreBuf
|
|
14841
|
+
ignoreBuf = textTheme.ignoreBuf,
|
|
14842
|
+
keepCenterInLine = textTheme.keepCenterInLine
|
|
14835
14843
|
} = attribute,
|
|
14836
14844
|
buf = ignoreBuf ? 0 : this.guessLineHeightBuf(fontSize),
|
|
14837
14845
|
lineHeight = this.getLineHeight(attribute, textTheme) + buf;
|
|
@@ -14849,7 +14857,8 @@ class Text extends Graphic {
|
|
|
14849
14857
|
}, textMeasure).GetLayoutByLines(text, textAlign, textBaseline, lineHeight, !0 === ellipsis ? textTheme.ellipsis : ellipsis || void 0, !1, {
|
|
14850
14858
|
lineWidth: maxLineWidth,
|
|
14851
14859
|
suffixPosition: suffixPosition,
|
|
14852
|
-
measureMode: measureMode
|
|
14860
|
+
measureMode: measureMode,
|
|
14861
|
+
keepCenterInLine: keepCenterInLine
|
|
14853
14862
|
}),
|
|
14854
14863
|
{
|
|
14855
14864
|
bbox: bbox
|
|
@@ -14874,7 +14883,8 @@ class Text extends Graphic {
|
|
|
14874
14883
|
measureMode = textTheme.measureMode,
|
|
14875
14884
|
suffixPosition = textTheme.suffixPosition,
|
|
14876
14885
|
heightLimit = 0,
|
|
14877
|
-
lineClamp: lineClamp
|
|
14886
|
+
lineClamp: lineClamp,
|
|
14887
|
+
keepCenterInLine = textTheme.keepCenterInLine
|
|
14878
14888
|
} = this.attribute,
|
|
14879
14889
|
buf = ignoreBuf ? 0 : this.guessLineHeightBuf(fontSize),
|
|
14880
14890
|
lineHeight = this.getLineHeight(this.attribute, textTheme) + buf;
|
|
@@ -14905,7 +14915,8 @@ class Text extends Graphic {
|
|
|
14905
14915
|
str: clip.str,
|
|
14906
14916
|
width: clip.width,
|
|
14907
14917
|
ascent: matrics.ascent,
|
|
14908
|
-
descent: matrics.descent
|
|
14918
|
+
descent: matrics.descent,
|
|
14919
|
+
keepCenterInLine: keepCenterInLine
|
|
14909
14920
|
});
|
|
14910
14921
|
break;
|
|
14911
14922
|
}
|
|
@@ -14922,7 +14933,8 @@ class Text extends Graphic {
|
|
|
14922
14933
|
str: clip.str,
|
|
14923
14934
|
width: clip.width,
|
|
14924
14935
|
ascent: matrics.ascent,
|
|
14925
|
-
descent: matrics.descent
|
|
14936
|
+
descent: matrics.descent,
|
|
14937
|
+
keepCenterInLine: keepCenterInLine
|
|
14926
14938
|
});
|
|
14927
14939
|
let cutLength = clip.str.length;
|
|
14928
14940
|
if (!clip.wordBreaked || "" !== str && "" === clip.str || (needCut = !0, cutLength = clip.wordBreaked), clip.str.length === str.length) ;else if (needCut) {
|
|
@@ -14946,7 +14958,8 @@ class Text extends Graphic {
|
|
|
14946
14958
|
str: clip.str,
|
|
14947
14959
|
width: clip.width,
|
|
14948
14960
|
ascent: matrics.ascent,
|
|
14949
|
-
descent: matrics.descent
|
|
14961
|
+
descent: matrics.descent,
|
|
14962
|
+
keepCenterInLine: keepCenterInLine
|
|
14950
14963
|
}), lineWidth = Math.max(lineWidth, clip.width);
|
|
14951
14964
|
break;
|
|
14952
14965
|
}
|
|
@@ -14956,7 +14969,8 @@ class Text extends Graphic {
|
|
|
14956
14969
|
str: text,
|
|
14957
14970
|
width: width,
|
|
14958
14971
|
ascent: matrics.ascent,
|
|
14959
|
-
descent: matrics.descent
|
|
14972
|
+
descent: matrics.descent,
|
|
14973
|
+
keepCenterInLine: keepCenterInLine
|
|
14960
14974
|
});
|
|
14961
14975
|
}
|
|
14962
14976
|
bboxWH[0] = lineWidth;
|
|
@@ -15153,7 +15167,8 @@ class WrapText extends Text {
|
|
|
15153
15167
|
str: clip.str,
|
|
15154
15168
|
width: clip.width,
|
|
15155
15169
|
ascent: 0,
|
|
15156
|
-
descent: 0
|
|
15170
|
+
descent: 0,
|
|
15171
|
+
keepCenterInLine: !1
|
|
15157
15172
|
});
|
|
15158
15173
|
break;
|
|
15159
15174
|
}
|
|
@@ -15169,7 +15184,8 @@ class WrapText extends Text {
|
|
|
15169
15184
|
str: clip.str,
|
|
15170
15185
|
width: clip.width,
|
|
15171
15186
|
ascent: 0,
|
|
15172
|
-
descent: 0
|
|
15187
|
+
descent: 0,
|
|
15188
|
+
keepCenterInLine: !1
|
|
15173
15189
|
}), clip.str.length === str.length) ;else if (needCut) {
|
|
15174
15190
|
const newStr = str.substring(clip.str.length);
|
|
15175
15191
|
lines.splice(i + 1, 0, newStr);
|
|
@@ -15190,7 +15206,8 @@ class WrapText extends Text {
|
|
|
15190
15206
|
str: clip.str,
|
|
15191
15207
|
width: clip.width,
|
|
15192
15208
|
ascent: 0,
|
|
15193
|
-
descent: 0
|
|
15209
|
+
descent: 0,
|
|
15210
|
+
keepCenterInLine: !1
|
|
15194
15211
|
}), lineWidth = Math.max(lineWidth, clip.width);
|
|
15195
15212
|
break;
|
|
15196
15213
|
}
|
|
@@ -15198,7 +15215,8 @@ class WrapText extends Text {
|
|
|
15198
15215
|
str: text,
|
|
15199
15216
|
width: width,
|
|
15200
15217
|
ascent: 0,
|
|
15201
|
-
descent: 0
|
|
15218
|
+
descent: 0,
|
|
15219
|
+
keepCenterInLine: !1
|
|
15202
15220
|
});
|
|
15203
15221
|
}
|
|
15204
15222
|
bboxWH[0] = lineWidth;
|
|
@@ -28621,7 +28639,7 @@ const registerWrapText = _registerWrapText;
|
|
|
28621
28639
|
|
|
28622
28640
|
const roughModule = _roughModule;
|
|
28623
28641
|
|
|
28624
|
-
const version = "0.21.0-alpha.
|
|
28642
|
+
const version = "0.21.0-alpha.11";
|
|
28625
28643
|
preLoadAllModule();
|
|
28626
28644
|
if (isBrowserEnv()) {
|
|
28627
28645
|
loadBrowserEnv(container);
|
package/dist/index.js
CHANGED
|
@@ -3957,7 +3957,8 @@
|
|
|
3957
3957
|
underlineDash: [],
|
|
3958
3958
|
underlineOffset: 0,
|
|
3959
3959
|
disableAutoClipedPoptip: void 0,
|
|
3960
|
-
measureMode: exports.MeasureModeEnum.fontBounding
|
|
3960
|
+
measureMode: exports.MeasureModeEnum.fontBounding,
|
|
3961
|
+
keepCenterInLine: !1
|
|
3961
3962
|
};
|
|
3962
3963
|
const DefaultPickStyle = {
|
|
3963
3964
|
pickStrokeBuffer: 0
|
|
@@ -14625,7 +14626,8 @@
|
|
|
14625
14626
|
const {
|
|
14626
14627
|
lineWidth: lineWidth,
|
|
14627
14628
|
suffixPosition = "end",
|
|
14628
|
-
measureMode = exports.MeasureModeEnum.actualBounding
|
|
14629
|
+
measureMode = exports.MeasureModeEnum.actualBounding,
|
|
14630
|
+
keepCenterInLine = !1
|
|
14629
14631
|
} = null != params ? params : {};
|
|
14630
14632
|
lines = lines.map(l => l.toString());
|
|
14631
14633
|
const linesLayout = [],
|
|
@@ -14638,7 +14640,8 @@
|
|
|
14638
14640
|
str: metrics.width <= lineWidth ? lines[i].toString() : this.textMeasure.clipTextWithSuffix(lines[i], this.textOptions, width, suffix, wordBreak, suffixPosition).str,
|
|
14639
14641
|
width: width,
|
|
14640
14642
|
ascent: metrics.ascent,
|
|
14641
|
-
descent: metrics.descent
|
|
14643
|
+
descent: metrics.descent,
|
|
14644
|
+
keepCenterInLine: keepCenterInLine
|
|
14642
14645
|
});
|
|
14643
14646
|
}
|
|
14644
14647
|
bboxWH[0] = lineWidth;
|
|
@@ -14653,7 +14656,8 @@
|
|
|
14653
14656
|
str: text,
|
|
14654
14657
|
width: width,
|
|
14655
14658
|
ascent: metrics.ascent,
|
|
14656
|
-
descent: metrics.descent
|
|
14659
|
+
descent: metrics.descent,
|
|
14660
|
+
keepCenterInLine: keepCenterInLine
|
|
14657
14661
|
});
|
|
14658
14662
|
}
|
|
14659
14663
|
bboxWH[0] = _lineWidth;
|
|
@@ -14684,9 +14688,12 @@
|
|
|
14684
14688
|
};
|
|
14685
14689
|
}
|
|
14686
14690
|
lineOffset(bbox, line, textAlign, textBaseline, lineHeight, origin) {
|
|
14687
|
-
"left" === textAlign || "start" === textAlign ? line.leftOffset = 0 : "center" === textAlign ? line.leftOffset = (bbox.width - line.width) / 2 : "right" !== textAlign && "end" !== textAlign || (line.leftOffset = bbox.width - line.width), line.topOffset = lineHeight / 2 + (line.ascent - line.descent) / 2 + origin[1]
|
|
14688
|
-
|
|
14689
|
-
|
|
14691
|
+
if ("left" === textAlign || "start" === textAlign ? line.leftOffset = 0 : "center" === textAlign ? line.leftOffset = (bbox.width - line.width) / 2 : "right" !== textAlign && "end" !== textAlign || (line.leftOffset = bbox.width - line.width), line.topOffset = lineHeight / 2 + (line.ascent - line.descent) / 2 + origin[1], !line.keepCenterInLine) {
|
|
14692
|
+
const buf = 0,
|
|
14693
|
+
actualHeightWithBuf = line.ascent + line.descent + buf;
|
|
14694
|
+
actualHeightWithBuf < lineHeight - buf && ("bottom" === textBaseline ? line.topOffset += (lineHeight - actualHeightWithBuf) / 2 : "top" === textBaseline && (line.topOffset -= (lineHeight - actualHeightWithBuf) / 2));
|
|
14695
|
+
}
|
|
14696
|
+
return origin[1] += lineHeight, line;
|
|
14690
14697
|
}
|
|
14691
14698
|
}
|
|
14692
14699
|
|
|
@@ -14837,7 +14844,8 @@
|
|
|
14837
14844
|
lineWidth = textTheme.lineWidth,
|
|
14838
14845
|
whiteSpace = textTheme.whiteSpace,
|
|
14839
14846
|
suffixPosition = textTheme.suffixPosition,
|
|
14840
|
-
ignoreBuf = textTheme.ignoreBuf
|
|
14847
|
+
ignoreBuf = textTheme.ignoreBuf,
|
|
14848
|
+
keepCenterInLine = textTheme.keepCenterInLine
|
|
14841
14849
|
} = attribute,
|
|
14842
14850
|
buf = ignoreBuf ? 0 : this.guessLineHeightBuf(fontSize),
|
|
14843
14851
|
lineHeight = this.getLineHeight(attribute, textTheme) + buf;
|
|
@@ -14855,7 +14863,8 @@
|
|
|
14855
14863
|
}, textMeasure).GetLayoutByLines(text, textAlign, textBaseline, lineHeight, !0 === ellipsis ? textTheme.ellipsis : ellipsis || void 0, !1, {
|
|
14856
14864
|
lineWidth: maxLineWidth,
|
|
14857
14865
|
suffixPosition: suffixPosition,
|
|
14858
|
-
measureMode: measureMode
|
|
14866
|
+
measureMode: measureMode,
|
|
14867
|
+
keepCenterInLine: keepCenterInLine
|
|
14859
14868
|
}),
|
|
14860
14869
|
{
|
|
14861
14870
|
bbox: bbox
|
|
@@ -14880,7 +14889,8 @@
|
|
|
14880
14889
|
measureMode = textTheme.measureMode,
|
|
14881
14890
|
suffixPosition = textTheme.suffixPosition,
|
|
14882
14891
|
heightLimit = 0,
|
|
14883
|
-
lineClamp: lineClamp
|
|
14892
|
+
lineClamp: lineClamp,
|
|
14893
|
+
keepCenterInLine = textTheme.keepCenterInLine
|
|
14884
14894
|
} = this.attribute,
|
|
14885
14895
|
buf = ignoreBuf ? 0 : this.guessLineHeightBuf(fontSize),
|
|
14886
14896
|
lineHeight = this.getLineHeight(this.attribute, textTheme) + buf;
|
|
@@ -14911,7 +14921,8 @@
|
|
|
14911
14921
|
str: clip.str,
|
|
14912
14922
|
width: clip.width,
|
|
14913
14923
|
ascent: matrics.ascent,
|
|
14914
|
-
descent: matrics.descent
|
|
14924
|
+
descent: matrics.descent,
|
|
14925
|
+
keepCenterInLine: keepCenterInLine
|
|
14915
14926
|
});
|
|
14916
14927
|
break;
|
|
14917
14928
|
}
|
|
@@ -14928,7 +14939,8 @@
|
|
|
14928
14939
|
str: clip.str,
|
|
14929
14940
|
width: clip.width,
|
|
14930
14941
|
ascent: matrics.ascent,
|
|
14931
|
-
descent: matrics.descent
|
|
14942
|
+
descent: matrics.descent,
|
|
14943
|
+
keepCenterInLine: keepCenterInLine
|
|
14932
14944
|
});
|
|
14933
14945
|
let cutLength = clip.str.length;
|
|
14934
14946
|
if (!clip.wordBreaked || "" !== str && "" === clip.str || (needCut = !0, cutLength = clip.wordBreaked), clip.str.length === str.length) ;else if (needCut) {
|
|
@@ -14952,7 +14964,8 @@
|
|
|
14952
14964
|
str: clip.str,
|
|
14953
14965
|
width: clip.width,
|
|
14954
14966
|
ascent: matrics.ascent,
|
|
14955
|
-
descent: matrics.descent
|
|
14967
|
+
descent: matrics.descent,
|
|
14968
|
+
keepCenterInLine: keepCenterInLine
|
|
14956
14969
|
}), lineWidth = Math.max(lineWidth, clip.width);
|
|
14957
14970
|
break;
|
|
14958
14971
|
}
|
|
@@ -14962,7 +14975,8 @@
|
|
|
14962
14975
|
str: text,
|
|
14963
14976
|
width: width,
|
|
14964
14977
|
ascent: matrics.ascent,
|
|
14965
|
-
descent: matrics.descent
|
|
14978
|
+
descent: matrics.descent,
|
|
14979
|
+
keepCenterInLine: keepCenterInLine
|
|
14966
14980
|
});
|
|
14967
14981
|
}
|
|
14968
14982
|
bboxWH[0] = lineWidth;
|
|
@@ -15159,7 +15173,8 @@
|
|
|
15159
15173
|
str: clip.str,
|
|
15160
15174
|
width: clip.width,
|
|
15161
15175
|
ascent: 0,
|
|
15162
|
-
descent: 0
|
|
15176
|
+
descent: 0,
|
|
15177
|
+
keepCenterInLine: !1
|
|
15163
15178
|
});
|
|
15164
15179
|
break;
|
|
15165
15180
|
}
|
|
@@ -15175,7 +15190,8 @@
|
|
|
15175
15190
|
str: clip.str,
|
|
15176
15191
|
width: clip.width,
|
|
15177
15192
|
ascent: 0,
|
|
15178
|
-
descent: 0
|
|
15193
|
+
descent: 0,
|
|
15194
|
+
keepCenterInLine: !1
|
|
15179
15195
|
}), clip.str.length === str.length) ;else if (needCut) {
|
|
15180
15196
|
const newStr = str.substring(clip.str.length);
|
|
15181
15197
|
lines.splice(i + 1, 0, newStr);
|
|
@@ -15196,7 +15212,8 @@
|
|
|
15196
15212
|
str: clip.str,
|
|
15197
15213
|
width: clip.width,
|
|
15198
15214
|
ascent: 0,
|
|
15199
|
-
descent: 0
|
|
15215
|
+
descent: 0,
|
|
15216
|
+
keepCenterInLine: !1
|
|
15200
15217
|
}), lineWidth = Math.max(lineWidth, clip.width);
|
|
15201
15218
|
break;
|
|
15202
15219
|
}
|
|
@@ -15204,7 +15221,8 @@
|
|
|
15204
15221
|
str: text,
|
|
15205
15222
|
width: width,
|
|
15206
15223
|
ascent: 0,
|
|
15207
|
-
descent: 0
|
|
15224
|
+
descent: 0,
|
|
15225
|
+
keepCenterInLine: !1
|
|
15208
15226
|
});
|
|
15209
15227
|
}
|
|
15210
15228
|
bboxWH[0] = lineWidth;
|
|
@@ -28627,7 +28645,7 @@
|
|
|
28627
28645
|
|
|
28628
28646
|
const roughModule = _roughModule;
|
|
28629
28647
|
|
|
28630
|
-
const version = "0.21.0-alpha.
|
|
28648
|
+
const version = "0.21.0-alpha.11";
|
|
28631
28649
|
preLoadAllModule();
|
|
28632
28650
|
if (isBrowserEnv()) {
|
|
28633
28651
|
loadBrowserEnv(container);
|