@visactor/vrender-core 0.21.0-vstory.2 → 0.21.0-vstory.3
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/animate/Ticker/default-ticker.d.ts +2 -1
- package/cjs/animate/Ticker/default-ticker.js +6 -3
- package/cjs/animate/Ticker/default-ticker.js.map +1 -1
- package/cjs/animate/custom-animate.d.ts +2 -0
- package/cjs/animate/custom-animate.js +11 -2
- package/cjs/animate/custom-animate.js.map +1 -1
- package/cjs/animate/easing.d.ts +1 -0
- package/cjs/animate/easing.js +3 -0
- package/cjs/animate/easing.js.map +1 -1
- package/cjs/animate/index.d.ts +1 -0
- package/cjs/animate/index.js +1 -1
- package/cjs/animate/index.js.map +1 -1
- package/cjs/canvas/util.js +1 -2
- package/cjs/color-string/store.js +2 -1
- package/cjs/common/color-utils.js +2 -2
- package/cjs/common/color-utils.js.map +1 -1
- package/cjs/common/utils.d.ts +1 -0
- package/cjs/common/utils.js +9 -2
- package/cjs/common/utils.js.map +1 -1
- package/cjs/core/contributions/textMeasure/AtextMeasure.d.ts +56 -4
- package/cjs/core/contributions/textMeasure/AtextMeasure.js +119 -18
- package/cjs/core/contributions/textMeasure/AtextMeasure.js.map +1 -1
- package/cjs/core/contributions/textMeasure/layout.d.ts +8 -3
- package/cjs/core/contributions/textMeasure/layout.js +55 -44
- package/cjs/core/contributions/textMeasure/layout.js.map +1 -1
- package/cjs/core/stage.d.ts +5 -0
- package/cjs/core/stage.js +20 -7
- package/cjs/core/stage.js.map +1 -1
- package/cjs/event/event-manager.d.ts +1 -0
- package/cjs/event/event-manager.js +1 -1
- package/cjs/event/event-manager.js.map +1 -1
- package/cjs/event/event-system.js +2 -1
- package/cjs/event/event-system.js.map +1 -1
- package/cjs/graphic/config.d.ts +1 -1
- package/cjs/graphic/config.js +7 -3
- package/cjs/graphic/config.js.map +1 -1
- package/cjs/graphic/node-tree.js +3 -3
- package/cjs/graphic/node-tree.js.map +1 -1
- package/cjs/graphic/richtext/line.js +9 -2
- package/cjs/graphic/richtext/line.js.map +1 -1
- package/cjs/graphic/richtext/paragraph.js +4 -3
- package/cjs/graphic/richtext/paragraph.js.map +1 -1
- package/cjs/graphic/richtext/utils.d.ts +2 -1
- package/cjs/graphic/richtext/utils.js +5 -3
- package/cjs/graphic/richtext/utils.js.map +1 -1
- package/cjs/graphic/text.d.ts +11 -11
- package/cjs/graphic/text.js +102 -168
- package/cjs/graphic/text.js.map +1 -1
- package/cjs/graphic/wrap-text.js +16 -4
- package/cjs/graphic/wrap-text.js.map +1 -1
- package/cjs/interface/animate.d.ts +1 -38
- package/cjs/interface/animate.js.map +1 -1
- package/cjs/interface/context.d.ts +1 -0
- package/cjs/interface/context.js.map +1 -1
- package/cjs/interface/graphic/text.d.ts +11 -3
- package/cjs/interface/graphic/text.js +6 -1
- package/cjs/interface/graphic/text.js.map +1 -1
- package/cjs/interface/graphic.d.ts +1 -0
- package/cjs/interface/graphic.js.map +1 -1
- package/cjs/interface/stage.d.ts +2 -0
- package/cjs/interface/stage.js.map +1 -1
- package/cjs/interface/text.d.ts +9 -1
- package/cjs/interface/text.js.map +1 -1
- package/cjs/plugins/builtin-plugin/auto-refresh-plugin.d.ts +16 -0
- package/cjs/plugins/builtin-plugin/auto-refresh-plugin.js +48 -0
- package/cjs/plugins/builtin-plugin/auto-refresh-plugin.js.map +1 -0
- package/cjs/render/contributions/render/contributions/arc-contribution-render.js +2 -2
- package/cjs/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/circle-contribution-render.js +2 -2
- package/cjs/render/contributions/render/contributions/circle-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/rect-contribution-render.js +2 -2
- package/cjs/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/symbol-contribution-render.js +2 -2
- package/cjs/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/draw-interceptor.js +3 -2
- package/cjs/render/contributions/render/draw-interceptor.js.map +1 -1
- package/cjs/render/contributions/render/text-render.d.ts +1 -1
- package/cjs/render/contributions/render/text-render.js +24 -46
- package/cjs/render/contributions/render/text-render.js.map +1 -1
- package/dist/index.es.js +8876 -8751
- package/es/animate/Ticker/default-ticker.d.ts +2 -1
- package/es/animate/Ticker/default-ticker.js +6 -3
- package/es/animate/Ticker/default-ticker.js.map +1 -1
- package/es/animate/custom-animate.d.ts +2 -0
- package/es/animate/custom-animate.js +11 -2
- package/es/animate/custom-animate.js.map +1 -1
- package/es/animate/easing.d.ts +1 -0
- package/es/animate/easing.js +3 -0
- package/es/animate/easing.js.map +1 -1
- package/es/animate/index.d.ts +1 -0
- package/es/animate/index.js +2 -0
- package/es/animate/index.js.map +1 -1
- package/es/canvas/util.js +1 -2
- package/es/color-string/store.js +2 -1
- package/es/common/color-utils.js +2 -2
- package/es/common/color-utils.js.map +1 -1
- package/es/common/utils.d.ts +1 -0
- package/es/common/utils.js +6 -1
- package/es/common/utils.js.map +1 -1
- package/es/core/contributions/textMeasure/AtextMeasure.d.ts +56 -4
- package/es/core/contributions/textMeasure/AtextMeasure.js +122 -17
- package/es/core/contributions/textMeasure/AtextMeasure.js.map +1 -1
- package/es/core/contributions/textMeasure/layout.d.ts +8 -3
- package/es/core/contributions/textMeasure/layout.js +55 -44
- package/es/core/contributions/textMeasure/layout.js.map +1 -1
- package/es/core/stage.d.ts +5 -0
- package/es/core/stage.js +21 -6
- package/es/core/stage.js.map +1 -1
- package/es/event/event-manager.d.ts +1 -0
- package/es/event/event-manager.js +1 -1
- package/es/event/event-manager.js.map +1 -1
- package/es/event/event-system.js +2 -1
- package/es/event/event-system.js.map +1 -1
- package/es/graphic/config.d.ts +1 -1
- package/es/graphic/config.js +8 -2
- package/es/graphic/config.js.map +1 -1
- package/es/graphic/node-tree.js +3 -3
- package/es/graphic/node-tree.js.map +1 -1
- package/es/graphic/richtext/line.js +10 -3
- package/es/graphic/richtext/line.js.map +1 -1
- package/es/graphic/richtext/paragraph.js +4 -3
- package/es/graphic/richtext/paragraph.js.map +1 -1
- package/es/graphic/richtext/utils.d.ts +2 -1
- package/es/graphic/richtext/utils.js +6 -2
- package/es/graphic/richtext/utils.js.map +1 -1
- package/es/graphic/text.d.ts +11 -11
- package/es/graphic/text.js +101 -163
- package/es/graphic/text.js.map +1 -1
- package/es/graphic/wrap-text.js +16 -4
- package/es/graphic/wrap-text.js.map +1 -1
- package/es/interface/animate.d.ts +1 -38
- package/es/interface/animate.js.map +1 -1
- package/es/interface/context.d.ts +1 -0
- package/es/interface/context.js.map +1 -1
- package/es/interface/graphic/text.d.ts +11 -3
- package/es/interface/graphic/text.js +6 -1
- package/es/interface/graphic/text.js.map +1 -1
- package/es/interface/graphic.d.ts +1 -0
- package/es/interface/graphic.js.map +1 -1
- package/es/interface/stage.d.ts +2 -0
- package/es/interface/stage.js.map +1 -1
- package/es/interface/text.d.ts +9 -1
- package/es/interface/text.js.map +1 -1
- package/es/plugins/builtin-plugin/auto-refresh-plugin.d.ts +16 -0
- package/es/plugins/builtin-plugin/auto-refresh-plugin.js +41 -0
- package/es/plugins/builtin-plugin/auto-refresh-plugin.js.map +1 -0
- package/es/render/contributions/render/contributions/arc-contribution-render.js +2 -2
- package/es/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/circle-contribution-render.js +2 -2
- package/es/render/contributions/render/contributions/circle-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/rect-contribution-render.js +2 -2
- package/es/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/symbol-contribution-render.js +2 -2
- package/es/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
- package/es/render/contributions/render/draw-interceptor.js +3 -2
- package/es/render/contributions/render/draw-interceptor.js.map +1 -1
- package/es/render/contributions/render/text-render.d.ts +1 -1
- package/es/render/contributions/render/text-render.js +23 -45
- package/es/render/contributions/render/text-render.js.map +1 -1
- package/package.json +4 -3
package/cjs/graphic/text.d.ts
CHANGED
|
@@ -48,7 +48,6 @@ export declare class Text extends Graphic<ITextGraphicAttribute> implements ITex
|
|
|
48
48
|
get clipedWidth(): number | undefined;
|
|
49
49
|
get cliped(): boolean | undefined;
|
|
50
50
|
get multilineLayout(): LayoutType | undefined;
|
|
51
|
-
private isSimplify;
|
|
52
51
|
get isMultiLine(): boolean;
|
|
53
52
|
constructor(params?: ITextGraphicAttribute);
|
|
54
53
|
isValid(): boolean;
|
|
@@ -56,10 +55,18 @@ export declare class Text extends Graphic<ITextGraphicAttribute> implements ITex
|
|
|
56
55
|
getGraphicTheme(): Required<ITextGraphicAttribute>;
|
|
57
56
|
protected doUpdateOBBBounds(): IOBBBounds;
|
|
58
57
|
protected updateAABBBounds(attribute: ITextGraphicAttribute, textTheme: Required<ITextGraphicAttribute>, aabbBounds: IAABBBounds): import("@visactor/vutils").IBounds;
|
|
59
|
-
updateWrapAABBBounds(text: (number | string) | (number | string)[]): import("@visactor/vutils").IBounds;
|
|
60
58
|
updateSingallineAABBBounds(text: number | string): IAABBBounds;
|
|
61
|
-
updateMultilineAABBBounds(text: (number | string)[]): IAABBBounds;
|
|
62
|
-
|
|
59
|
+
protected updateMultilineAABBBounds(text: (number | string)[]): IAABBBounds;
|
|
60
|
+
guessLineHeightBuf(fontSize: number): number;
|
|
61
|
+
updateHorizontalMultilineAABBBounds(text: (number | string)[]): IAABBBounds;
|
|
62
|
+
updateWrapAABBBounds(text: (number | string) | (number | string)[]): import("@visactor/vutils").IBounds;
|
|
63
|
+
updateVerticalMultilineAABBBounds(text: (number | string)[]): IAABBBounds;
|
|
64
|
+
protected getMaxWidth(theme: ITextGraphicAttribute): number;
|
|
65
|
+
protected getLineHeight(attribute: ITextGraphicAttribute, textTheme: ITextGraphicAttribute, buf: number): number;
|
|
66
|
+
protected needUpdateTags(keys: string[], k?: string[]): boolean;
|
|
67
|
+
protected needUpdateTag(key: string, k?: string[]): boolean;
|
|
68
|
+
clone(): Text;
|
|
69
|
+
getNoWorkAnimateAttr(): Record<string, number>;
|
|
63
70
|
getBaselineMapAlign(): Record<string, string>;
|
|
64
71
|
getAlignMapBaseline(): Record<string, string>;
|
|
65
72
|
static baselineMapAlign: {
|
|
@@ -72,12 +79,5 @@ export declare class Text extends Graphic<ITextGraphicAttribute> implements ITex
|
|
|
72
79
|
right: string;
|
|
73
80
|
center: string;
|
|
74
81
|
};
|
|
75
|
-
updateVerticalSinglelineAABBBounds(text: number | string): IAABBBounds;
|
|
76
|
-
updateHorizontalMultilineAABBBounds(text: (number | string)[]): IAABBBounds;
|
|
77
|
-
updateVerticalMultilineAABBBounds(text: (number | string)[]): IAABBBounds;
|
|
78
|
-
protected needUpdateTags(keys: string[], k?: string[]): boolean;
|
|
79
|
-
protected needUpdateTag(key: string, k?: string[]): boolean;
|
|
80
|
-
clone(): Text;
|
|
81
|
-
getNoWorkAnimateAttr(): Record<string, number>;
|
|
82
82
|
}
|
|
83
83
|
export declare function createText(attributes: ITextGraphicAttribute): IText;
|
package/cjs/graphic/text.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.createText = exports.Text = void 0;
|
|
6
6
|
|
|
7
|
-
const vutils_1 = require("@visactor/vutils"), text_1 = require("../common/text"), layout_1 = require("../core/contributions/textMeasure/layout"), application_1 = require("../application"), graphic_1 = require("./graphic"), theme_1 = require("./theme"), utils_1 = require("../common/utils"), constants_1 = require("./constants"), tools_1 = require("./tools"), TEXT_UPDATE_TAG_KEY = [ "text", "maxLineWidth", "textAlign", "textBaseline", "heightLimit", "lineClamp", "fontSize", "fontFamily", "fontWeight", "ellipsis", "lineHeight", "direction", "wordBreak", "heightLimit", "lineClamp", ...graphic_1.GRAPHIC_UPDATE_TAG_KEY ];
|
|
7
|
+
const vutils_1 = require("@visactor/vutils"), text_1 = require("../common/text"), layout_1 = require("../core/contributions/textMeasure/layout"), application_1 = require("../application"), graphic_1 = require("./graphic"), theme_1 = require("./theme"), utils_1 = require("../common/utils"), constants_1 = require("./constants"), tools_1 = require("./tools"), TEXT_UPDATE_TAG_KEY = [ "text", "maxLineWidth", "maxWidth", "textAlign", "textBaseline", "heightLimit", "lineClamp", "fontSize", "fontFamily", "fontWeight", "ellipsis", "lineHeight", "direction", "wordBreak", "heightLimit", "lineClamp", ...graphic_1.GRAPHIC_UPDATE_TAG_KEY ];
|
|
8
8
|
|
|
9
9
|
class Text extends graphic_1.Graphic {
|
|
10
10
|
get font() {
|
|
@@ -14,18 +14,17 @@ class Text extends graphic_1.Graphic {
|
|
|
14
14
|
}
|
|
15
15
|
get clipedText() {
|
|
16
16
|
var _a;
|
|
17
|
-
const attribute = this.attribute, textTheme = this.getGraphicTheme();
|
|
18
|
-
|
|
19
|
-
const {maxLineWidth: maxLineWidth = textTheme.maxLineWidth} = attribute;
|
|
20
|
-
return Number.isFinite(maxLineWidth) ? (this.tryUpdateAABBBounds(), this.cache.clipedText) : (null !== (_a = attribute.text) && void 0 !== _a ? _a : textTheme.text).toString();
|
|
17
|
+
const attribute = this.attribute, textTheme = this.getGraphicTheme(), maxWidth = this.getMaxWidth(textTheme);
|
|
18
|
+
return Number.isFinite(maxWidth) ? (this.tryUpdateAABBBounds(), this.cache.clipedText) : (null !== (_a = attribute.text) && void 0 !== _a ? _a : textTheme.text).toString();
|
|
21
19
|
}
|
|
22
20
|
get clipedWidth() {
|
|
23
|
-
|
|
21
|
+
return this.tryUpdateAABBBounds(), this.cache.clipedWidth;
|
|
24
22
|
}
|
|
25
23
|
get cliped() {
|
|
26
24
|
var _a, _b;
|
|
27
|
-
const textTheme = this.getGraphicTheme(), attribute = this.attribute,
|
|
28
|
-
if (!Number.isFinite(
|
|
25
|
+
const textTheme = this.getGraphicTheme(), attribute = this.attribute, maxWidth = this.getMaxWidth(textTheme);
|
|
26
|
+
if (!Number.isFinite(maxWidth)) return !1;
|
|
27
|
+
const {text: text} = this.attribute;
|
|
29
28
|
if (this.tryUpdateAABBBounds(), null === (_b = null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData) || void 0 === _b ? void 0 : _b.lines) {
|
|
30
29
|
let mergedText = "";
|
|
31
30
|
this.cache.layoutData.lines.forEach((item => {
|
|
@@ -36,10 +35,7 @@ class Text extends graphic_1.Graphic {
|
|
|
36
35
|
return "vertical" === attribute.direction && this.cache.verticalList && this.cache.verticalList[0] ? this.cache.verticalList[0].map((item => item.text)).join("") !== attribute.text.toString() : null != this.clipedText && this.clipedText !== attribute.text.toString();
|
|
37
36
|
}
|
|
38
37
|
get multilineLayout() {
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
isSimplify() {
|
|
42
|
-
return !this.isMultiLine && "vertical" !== this.attribute.direction;
|
|
38
|
+
return this.tryUpdateAABBBounds(), this.cache.layoutData;
|
|
43
39
|
}
|
|
44
40
|
get isMultiLine() {
|
|
45
41
|
return Array.isArray(this.attribute.text) || "normal" === this.attribute.whiteSpace;
|
|
@@ -95,20 +91,61 @@ class Text extends graphic_1.Graphic {
|
|
|
95
91
|
(0, vutils_1.transformBoundsWithMatrix)(aabbBounds, aabbBounds, this.transMatrix),
|
|
96
92
|
aabbBounds;
|
|
97
93
|
}
|
|
94
|
+
updateSingallineAABBBounds(text) {
|
|
95
|
+
this.updateMultilineAABBBounds([ text ]);
|
|
96
|
+
const layoutData = this.cache.layoutData;
|
|
97
|
+
if (layoutData && layoutData.lines && layoutData.lines.length) {
|
|
98
|
+
const line = layoutData.lines[0];
|
|
99
|
+
this.cache.clipedText = line.str, this.cache.clipedWidth = line.width;
|
|
100
|
+
}
|
|
101
|
+
return this._AABBBounds;
|
|
102
|
+
}
|
|
103
|
+
updateMultilineAABBBounds(text) {
|
|
104
|
+
const textTheme = this.getGraphicTheme(), {direction: direction = textTheme.direction, underlineOffset: underlineOffset = textTheme.underlineOffset} = this.attribute, b = "horizontal" === direction ? this.updateHorizontalMultilineAABBBounds(text) : this.updateVerticalMultilineAABBBounds(text);
|
|
105
|
+
return "horizontal" === direction && underlineOffset && this._AABBBounds.add(this._AABBBounds.x1, this._AABBBounds.y2 + underlineOffset),
|
|
106
|
+
b;
|
|
107
|
+
}
|
|
108
|
+
guessLineHeightBuf(fontSize) {
|
|
109
|
+
return fontSize ? .1 * fontSize : 0;
|
|
110
|
+
}
|
|
111
|
+
updateHorizontalMultilineAABBBounds(text) {
|
|
112
|
+
var _a;
|
|
113
|
+
const textTheme = this.getGraphicTheme(), attribute = this.attribute, {fontFamily: fontFamily = textTheme.fontFamily, textAlign: textAlign = textTheme.textAlign, textBaseline: textBaseline = textTheme.textBaseline, fontSize: fontSize = textTheme.fontSize, fontWeight: fontWeight = textTheme.fontWeight, ellipsis: ellipsis = textTheme.ellipsis, maxLineWidth: maxLineWidth, stroke: stroke = textTheme.stroke, wrap: wrap = textTheme.wrap, measureMode: measureMode = textTheme.measureMode, lineWidth: lineWidth = textTheme.lineWidth, whiteSpace: whiteSpace = textTheme.whiteSpace, suffixPosition: suffixPosition = textTheme.suffixPosition, ignoreBuf: ignoreBuf = textTheme.ignoreBuf, keepCenterInLine: keepCenterInLine = textTheme.keepCenterInLine} = attribute, buf = ignoreBuf ? 0 : this.guessLineHeightBuf(fontSize), lineHeight = this.getLineHeight(attribute, textTheme, buf);
|
|
114
|
+
if ("normal" === whiteSpace || wrap) return this.updateWrapAABBBounds(text);
|
|
115
|
+
if (!this.shouldUpdateShape() && (null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData)) {
|
|
116
|
+
const bbox = this.cache.layoutData.bbox;
|
|
117
|
+
return this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height),
|
|
118
|
+
stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
119
|
+
}
|
|
120
|
+
const textMeasure = application_1.application.graphicUtil.textMeasure, layoutData = new layout_1.CanvasTextLayout(fontFamily, {
|
|
121
|
+
fontSize: fontSize,
|
|
122
|
+
fontWeight: fontWeight,
|
|
123
|
+
fontFamily: fontFamily,
|
|
124
|
+
lineHeight: lineHeight
|
|
125
|
+
}, textMeasure).GetLayoutByLines(text, textAlign, textBaseline, lineHeight, !0 === ellipsis ? textTheme.ellipsis : ellipsis || void 0, !1, {
|
|
126
|
+
lineWidth: maxLineWidth,
|
|
127
|
+
suffixPosition: suffixPosition,
|
|
128
|
+
measureMode: measureMode,
|
|
129
|
+
keepCenterInLine: keepCenterInLine
|
|
130
|
+
}), {bbox: bbox} = layoutData;
|
|
131
|
+
return this.cache.layoutData = layoutData, this.clearUpdateShapeTag(), this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height),
|
|
132
|
+
stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
133
|
+
}
|
|
98
134
|
updateWrapAABBBounds(text) {
|
|
99
|
-
var _a, _b, _c
|
|
100
|
-
const textTheme = this.getGraphicTheme(), {fontFamily: fontFamily = textTheme.fontFamily, textAlign: textAlign = textTheme.textAlign, textBaseline: textBaseline = textTheme.textBaseline, fontSize: fontSize = textTheme.fontSize, ellipsis: ellipsis = textTheme.ellipsis, maxLineWidth: maxLineWidth, stroke: stroke = textTheme.stroke, lineWidth: lineWidth = textTheme.lineWidth, wordBreak: wordBreak = textTheme.wordBreak, fontWeight: fontWeight = textTheme.fontWeight, ignoreBuf: ignoreBuf = textTheme.ignoreBuf, suffixPosition: suffixPosition = textTheme.suffixPosition, heightLimit: heightLimit = 0, lineClamp: lineClamp} = this.attribute,
|
|
101
|
-
|
|
102
|
-
if (!this.shouldUpdateShape() && (null === (_b = this.cache) || void 0 === _b ? void 0 : _b.layoutData)) {
|
|
135
|
+
var _a, _b, _c;
|
|
136
|
+
const textTheme = this.getGraphicTheme(), {fontFamily: fontFamily = textTheme.fontFamily, textAlign: textAlign = textTheme.textAlign, textBaseline: textBaseline = textTheme.textBaseline, fontSize: fontSize = textTheme.fontSize, ellipsis: ellipsis = textTheme.ellipsis, maxLineWidth: maxLineWidth, stroke: stroke = textTheme.stroke, lineWidth: lineWidth = textTheme.lineWidth, wordBreak: wordBreak = textTheme.wordBreak, fontWeight: fontWeight = textTheme.fontWeight, ignoreBuf: ignoreBuf = textTheme.ignoreBuf, measureMode: measureMode = textTheme.measureMode, suffixPosition: suffixPosition = textTheme.suffixPosition, heightLimit: heightLimit = 0, lineClamp: lineClamp, keepCenterInLine: keepCenterInLine = textTheme.keepCenterInLine} = this.attribute, buf = ignoreBuf ? 0 : this.guessLineHeightBuf(fontSize), lineHeight = this.getLineHeight(this.attribute, textTheme, buf);
|
|
137
|
+
if (!this.shouldUpdateShape() && (null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData)) {
|
|
103
138
|
const bbox = this.cache.layoutData.bbox;
|
|
104
139
|
return this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height),
|
|
105
140
|
stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
106
141
|
}
|
|
107
|
-
const textMeasure = application_1.application.graphicUtil.textMeasure,
|
|
142
|
+
const textMeasure = application_1.application.graphicUtil.textMeasure, textOptions = {
|
|
108
143
|
fontSize: fontSize,
|
|
109
144
|
fontWeight: fontWeight,
|
|
110
|
-
fontFamily: fontFamily
|
|
111
|
-
|
|
145
|
+
fontFamily: fontFamily,
|
|
146
|
+
lineHeight: lineHeight
|
|
147
|
+
}, layoutObj = new layout_1.CanvasTextLayout(fontFamily, textOptions, textMeasure), lines = (0,
|
|
148
|
+
vutils_1.isArray)(text) ? text.map((l => l.toString())) : [ text.toString() ], linesLayout = [], bboxWH = [ 0, 0 ];
|
|
112
149
|
let lineCountLimit = 1 / 0;
|
|
113
150
|
if (heightLimit > 0 && (lineCountLimit = Math.max(Math.floor(heightLimit / lineHeight), 1)),
|
|
114
151
|
lineClamp && (lineCountLimit = Math.min(lineCountLimit, lineClamp)), "number" == typeof maxLineWidth && maxLineWidth !== 1 / 0) {
|
|
@@ -116,24 +153,31 @@ class Text extends graphic_1.Graphic {
|
|
|
116
153
|
const str = lines[i];
|
|
117
154
|
let needCut = !0;
|
|
118
155
|
if (i === lineCountLimit - 1) {
|
|
119
|
-
const clip =
|
|
156
|
+
const clip = textMeasure.clipTextWithSuffix(str, textOptions, maxLineWidth, ellipsis, !1, suffixPosition, i !== lines.length - 1), matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);
|
|
120
157
|
linesLayout.push({
|
|
121
158
|
str: clip.str,
|
|
122
|
-
width: clip.width
|
|
159
|
+
width: clip.width,
|
|
160
|
+
ascent: matrics.ascent,
|
|
161
|
+
descent: matrics.descent,
|
|
162
|
+
keepCenterInLine: keepCenterInLine
|
|
123
163
|
});
|
|
124
164
|
break;
|
|
125
165
|
}
|
|
126
|
-
const clip =
|
|
166
|
+
const clip = textMeasure.clipText(str, textOptions, maxLineWidth, "break-all" !== wordBreak, "keep-all" === wordBreak);
|
|
127
167
|
if ("" !== str && "" === clip.str || clip.wordBreaked) {
|
|
128
168
|
if (ellipsis) {
|
|
129
|
-
const clipEllipsis =
|
|
130
|
-
clip.str = null !== (
|
|
169
|
+
const clipEllipsis = textMeasure.clipTextWithSuffix(str, textOptions, maxLineWidth, ellipsis, !1, suffixPosition);
|
|
170
|
+
clip.str = null !== (_b = clipEllipsis.str) && void 0 !== _b ? _b : "", clip.width = null !== (_c = clipEllipsis.width) && void 0 !== _c ? _c : 0;
|
|
131
171
|
} else clip.str = "", clip.width = 0;
|
|
132
172
|
needCut = !1;
|
|
133
173
|
}
|
|
174
|
+
const matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);
|
|
134
175
|
linesLayout.push({
|
|
135
176
|
str: clip.str,
|
|
136
|
-
width: clip.width
|
|
177
|
+
width: clip.width,
|
|
178
|
+
ascent: matrics.ascent,
|
|
179
|
+
descent: matrics.descent,
|
|
180
|
+
keepCenterInLine: keepCenterInLine
|
|
137
181
|
});
|
|
138
182
|
let cutLength = clip.str.length;
|
|
139
183
|
if (!clip.wordBreaked || "" !== str && "" === clip.str || (needCut = !0, cutLength = clip.wordBreaked),
|
|
@@ -150,175 +194,50 @@ class Text extends graphic_1.Graphic {
|
|
|
150
194
|
let width, text, lineWidth = 0;
|
|
151
195
|
for (let i = 0, len = lines.length; i < len; i++) {
|
|
152
196
|
if (i === lineCountLimit - 1) {
|
|
153
|
-
const clip =
|
|
197
|
+
const clip = textMeasure.clipTextWithSuffix(lines[i], textOptions, maxLineWidth, ellipsis, !1, suffixPosition), matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);
|
|
154
198
|
linesLayout.push({
|
|
155
199
|
str: clip.str,
|
|
156
|
-
width: clip.width
|
|
200
|
+
width: clip.width,
|
|
201
|
+
ascent: matrics.ascent,
|
|
202
|
+
descent: matrics.descent,
|
|
203
|
+
keepCenterInLine: keepCenterInLine
|
|
157
204
|
}), lineWidth = Math.max(lineWidth, clip.width);
|
|
158
205
|
break;
|
|
159
206
|
}
|
|
160
|
-
text = lines[i], width =
|
|
161
|
-
|
|
207
|
+
text = lines[i], width = textMeasure.measureTextWidth(text, textOptions), lineWidth = Math.max(lineWidth, width);
|
|
208
|
+
const matrics = textMeasure.measureTextPixelADscentAndWidth(text, textOptions, measureMode);
|
|
209
|
+
linesLayout.push({
|
|
162
210
|
str: text,
|
|
163
|
-
width: width
|
|
211
|
+
width: width,
|
|
212
|
+
ascent: matrics.ascent,
|
|
213
|
+
descent: matrics.descent,
|
|
214
|
+
keepCenterInLine: keepCenterInLine
|
|
164
215
|
});
|
|
165
216
|
}
|
|
166
217
|
bboxWH[0] = lineWidth;
|
|
167
218
|
}
|
|
168
|
-
bboxWH[1] = linesLayout.length *
|
|
219
|
+
bboxWH[1] = linesLayout.length * lineHeight;
|
|
169
220
|
const bbox = {
|
|
170
221
|
xOffset: 0,
|
|
171
222
|
yOffset: 0,
|
|
172
223
|
width: bboxWH[0],
|
|
173
224
|
height: bboxWH[1]
|
|
174
225
|
};
|
|
175
|
-
layoutObj.LayoutBBox(bbox, textAlign, textBaseline);
|
|
226
|
+
layoutObj.LayoutBBox(bbox, textAlign, textBaseline, linesLayout);
|
|
176
227
|
const layoutData = layoutObj.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline, lineHeight);
|
|
177
228
|
return this.cache.layoutData = layoutData, this.clearUpdateShapeTag(), this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height),
|
|
178
229
|
stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
179
230
|
}
|
|
180
|
-
updateSingallineAABBBounds(text) {
|
|
181
|
-
const textTheme = this.getGraphicTheme(), {direction: direction = textTheme.direction, underlineOffset: underlineOffset = textTheme.underlineOffset} = this.attribute, b = "horizontal" === direction ? this.updateHorizontalSinglelineAABBBounds(text) : this.updateVerticalSinglelineAABBBounds(text);
|
|
182
|
-
return "horizontal" === direction && underlineOffset && this._AABBBounds.add(this._AABBBounds.x1, this._AABBBounds.y2 + underlineOffset),
|
|
183
|
-
b;
|
|
184
|
-
}
|
|
185
|
-
updateMultilineAABBBounds(text) {
|
|
186
|
-
const textTheme = this.getGraphicTheme(), {direction: direction = textTheme.direction, underlineOffset: underlineOffset = textTheme.underlineOffset} = this.attribute, b = "horizontal" === direction ? this.updateHorizontalMultilineAABBBounds(text) : this.updateVerticalMultilineAABBBounds(text);
|
|
187
|
-
return "horizontal" === direction && underlineOffset && this._AABBBounds.add(this._AABBBounds.x1, this._AABBBounds.y2 + underlineOffset),
|
|
188
|
-
b;
|
|
189
|
-
}
|
|
190
|
-
updateHorizontalSinglelineAABBBounds(text) {
|
|
191
|
-
var _a, _b;
|
|
192
|
-
const textTheme = this.getGraphicTheme(), {wrap: wrap = textTheme.wrap} = this.attribute;
|
|
193
|
-
if (wrap) return this.updateWrapAABBBounds([ text ]);
|
|
194
|
-
const textMeasure = application_1.application.graphicUtil.textMeasure;
|
|
195
|
-
let width, str;
|
|
196
|
-
const attribute = this.attribute, {maxLineWidth: maxLineWidth = textTheme.maxLineWidth, ellipsis: ellipsis = textTheme.ellipsis, textAlign: textAlign = textTheme.textAlign, textBaseline: textBaseline = textTheme.textBaseline, fontFamily: fontFamily = textTheme.fontFamily, fontSize: fontSize = textTheme.fontSize, fontWeight: fontWeight = textTheme.fontWeight, stroke: stroke = textTheme.stroke, lineWidth: lineWidth = textTheme.lineWidth, ignoreBuf: ignoreBuf = textTheme.ignoreBuf, whiteSpace: whiteSpace = textTheme.whiteSpace, suffixPosition: suffixPosition = textTheme.suffixPosition} = attribute;
|
|
197
|
-
if ("normal" === whiteSpace) return this.updateWrapAABBBounds(text);
|
|
198
|
-
const buf = ignoreBuf ? 0 : Math.max(2, .075 * fontSize), textFontSize = attribute.fontSize || textTheme.fontSize, lineHeight = null !== (_a = (0,
|
|
199
|
-
utils_1.calculateLineHeight)(attribute.lineHeight, textFontSize)) && void 0 !== _a ? _a : textFontSize + buf;
|
|
200
|
-
if (!this.shouldUpdateShape() && this.cache) {
|
|
201
|
-
width = null !== (_b = this.cache.clipedWidth) && void 0 !== _b ? _b : 0;
|
|
202
|
-
const dx = (0, text_1.textDrawOffsetX)(textAlign, width), dy = (0, text_1.textLayoutOffsetY)(textBaseline, lineHeight, fontSize);
|
|
203
|
-
return this._AABBBounds.set(dx, dy, dx + width, dy + lineHeight), stroke && this._AABBBounds.expand(lineWidth / 2),
|
|
204
|
-
this._AABBBounds;
|
|
205
|
-
}
|
|
206
|
-
if (Number.isFinite(maxLineWidth)) {
|
|
207
|
-
if (ellipsis) {
|
|
208
|
-
const strEllipsis = !0 === ellipsis ? textTheme.ellipsis : ellipsis, data = textMeasure.clipTextWithSuffix(text.toString(), {
|
|
209
|
-
fontSize: fontSize,
|
|
210
|
-
fontWeight: fontWeight,
|
|
211
|
-
fontFamily: fontFamily
|
|
212
|
-
}, maxLineWidth, strEllipsis, !1, suffixPosition);
|
|
213
|
-
str = data.str, width = data.width;
|
|
214
|
-
} else {
|
|
215
|
-
const data = textMeasure.clipText(text.toString(), {
|
|
216
|
-
fontSize: fontSize,
|
|
217
|
-
fontWeight: fontWeight,
|
|
218
|
-
fontFamily: fontFamily
|
|
219
|
-
}, maxLineWidth, !1);
|
|
220
|
-
str = data.str, width = data.width;
|
|
221
|
-
}
|
|
222
|
-
this.cache.clipedText = str, this.cache.clipedWidth = width;
|
|
223
|
-
} else width = textMeasure.measureTextWidth(text.toString(), {
|
|
224
|
-
fontSize: fontSize,
|
|
225
|
-
fontWeight: fontWeight,
|
|
226
|
-
fontFamily: fontFamily
|
|
227
|
-
}), this.cache.clipedText = text.toString(), this.cache.clipedWidth = width;
|
|
228
|
-
this.clearUpdateShapeTag();
|
|
229
|
-
const dx = (0, text_1.textDrawOffsetX)(textAlign, width);
|
|
230
|
-
let lh = lineHeight;
|
|
231
|
-
application_1.application.global && application_1.application.global.isSafari() && (lh += .2 * fontSize);
|
|
232
|
-
const dy = (0, text_1.textLayoutOffsetY)(textBaseline, lh, fontSize, buf);
|
|
233
|
-
return this._AABBBounds.set(dx, dy, dx + width, dy + lh), stroke && this._AABBBounds.expand(lineWidth / 2),
|
|
234
|
-
this._AABBBounds;
|
|
235
|
-
}
|
|
236
|
-
getBaselineMapAlign() {
|
|
237
|
-
return Text.baselineMapAlign;
|
|
238
|
-
}
|
|
239
|
-
getAlignMapBaseline() {
|
|
240
|
-
return Text.alignMapBaseline;
|
|
241
|
-
}
|
|
242
|
-
updateVerticalSinglelineAABBBounds(text) {
|
|
243
|
-
var _a, _b, _c;
|
|
244
|
-
const textTheme = this.getGraphicTheme(), textMeasure = application_1.application.graphicUtil.textMeasure;
|
|
245
|
-
let width;
|
|
246
|
-
const attribute = this.attribute, {ignoreBuf: ignoreBuf = textTheme.ignoreBuf} = attribute, buf = ignoreBuf ? 0 : 2, {maxLineWidth: maxLineWidth = textTheme.maxLineWidth, ellipsis: ellipsis = textTheme.ellipsis, fontSize: fontSize = textTheme.fontSize, fontWeight: fontWeight = textTheme.fontWeight, fontFamily: fontFamily = textTheme.fontFamily, stroke: stroke = textTheme.stroke, lineWidth: lineWidth = textTheme.lineWidth, verticalMode: verticalMode = textTheme.verticalMode, suffixPosition: suffixPosition = textTheme.suffixPosition} = attribute, lineHeight = null !== (_a = (0,
|
|
247
|
-
utils_1.calculateLineHeight)(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
|
|
248
|
-
let {textAlign: textAlign = textTheme.textAlign, textBaseline: textBaseline = textTheme.textBaseline} = attribute;
|
|
249
|
-
if (!verticalMode) {
|
|
250
|
-
const t = textAlign;
|
|
251
|
-
textAlign = null !== (_b = Text.baselineMapAlign[textBaseline]) && void 0 !== _b ? _b : "left",
|
|
252
|
-
textBaseline = null !== (_c = Text.alignMapBaseline[t]) && void 0 !== _c ? _c : "top";
|
|
253
|
-
}
|
|
254
|
-
if (!this.shouldUpdateShape() && this.cache) {
|
|
255
|
-
width = this.cache.clipedWidth;
|
|
256
|
-
const dx = (0, text_1.textDrawOffsetX)(textAlign, width), dy = (0, text_1.textLayoutOffsetY)(textBaseline, lineHeight, fontSize);
|
|
257
|
-
return this._AABBBounds.set(dy, dx, dy + lineHeight, dx + width), stroke && this._AABBBounds.expand(lineWidth / 2),
|
|
258
|
-
this._AABBBounds;
|
|
259
|
-
}
|
|
260
|
-
let verticalList = [ (0, tools_1.verticalLayout)(text.toString()) ];
|
|
261
|
-
if (Number.isFinite(maxLineWidth)) {
|
|
262
|
-
if (ellipsis) {
|
|
263
|
-
const strEllipsis = !0 === ellipsis ? textTheme.ellipsis : ellipsis, data = textMeasure.clipTextWithSuffixVertical(verticalList[0], {
|
|
264
|
-
fontSize: fontSize,
|
|
265
|
-
fontWeight: fontWeight,
|
|
266
|
-
fontFamily: fontFamily
|
|
267
|
-
}, maxLineWidth, strEllipsis, !1, suffixPosition);
|
|
268
|
-
verticalList = [ data.verticalList ], width = data.width;
|
|
269
|
-
} else {
|
|
270
|
-
const data = textMeasure.clipTextVertical(verticalList[0], {
|
|
271
|
-
fontSize: fontSize,
|
|
272
|
-
fontWeight: fontWeight,
|
|
273
|
-
fontFamily: fontFamily
|
|
274
|
-
}, maxLineWidth, !1);
|
|
275
|
-
verticalList = [ data.verticalList ], width = data.width;
|
|
276
|
-
}
|
|
277
|
-
this.cache.verticalList = verticalList, this.cache.clipedWidth = width;
|
|
278
|
-
} else width = 0, verticalList[0].forEach((t => {
|
|
279
|
-
const w = t.direction === tools_1.TextDirection.HORIZONTAL ? fontSize : textMeasure.measureTextWidth(t.text, {
|
|
280
|
-
fontSize: fontSize,
|
|
281
|
-
fontWeight: fontWeight,
|
|
282
|
-
fontFamily: fontFamily
|
|
283
|
-
});
|
|
284
|
-
width += w, t.width = w;
|
|
285
|
-
})), this.cache.verticalList = verticalList, this.cache.clipedWidth = width;
|
|
286
|
-
this.clearUpdateShapeTag();
|
|
287
|
-
const dx = (0, text_1.textDrawOffsetX)(textAlign, width), dy = (0, text_1.textLayoutOffsetY)(textBaseline, lineHeight, fontSize);
|
|
288
|
-
return this._AABBBounds.set(dy, dx, dy + lineHeight, dx + width), stroke && this._AABBBounds.expand(lineWidth / 2),
|
|
289
|
-
this._AABBBounds;
|
|
290
|
-
}
|
|
291
|
-
updateHorizontalMultilineAABBBounds(text) {
|
|
292
|
-
var _a, _b;
|
|
293
|
-
const textTheme = this.getGraphicTheme(), {wrap: wrap = textTheme.wrap} = this.attribute;
|
|
294
|
-
if (wrap) return this.updateWrapAABBBounds(text);
|
|
295
|
-
const attribute = this.attribute, {fontFamily: fontFamily = textTheme.fontFamily, textAlign: textAlign = textTheme.textAlign, textBaseline: textBaseline = textTheme.textBaseline, fontSize: fontSize = textTheme.fontSize, fontWeight: fontWeight = textTheme.fontWeight, ellipsis: ellipsis = textTheme.ellipsis, maxLineWidth: maxLineWidth, stroke: stroke = textTheme.stroke, lineWidth: lineWidth = textTheme.lineWidth, whiteSpace: whiteSpace = textTheme.whiteSpace, suffixPosition: suffixPosition = textTheme.suffixPosition} = attribute, lineHeight = null !== (_a = (0,
|
|
296
|
-
utils_1.calculateLineHeight)(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : attribute.fontSize || textTheme.fontSize;
|
|
297
|
-
if ("normal" === whiteSpace) return this.updateWrapAABBBounds(text);
|
|
298
|
-
if (!this.shouldUpdateShape() && (null === (_b = this.cache) || void 0 === _b ? void 0 : _b.layoutData)) {
|
|
299
|
-
const bbox = this.cache.layoutData.bbox;
|
|
300
|
-
return this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height),
|
|
301
|
-
stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
302
|
-
}
|
|
303
|
-
const textMeasure = application_1.application.graphicUtil.textMeasure, layoutData = new layout_1.CanvasTextLayout(fontFamily, {
|
|
304
|
-
fontSize: fontSize,
|
|
305
|
-
fontWeight: fontWeight,
|
|
306
|
-
fontFamily: fontFamily
|
|
307
|
-
}, textMeasure).GetLayoutByLines(text, textAlign, textBaseline, lineHeight, !0 === ellipsis ? textTheme.ellipsis : ellipsis || void 0, !1, maxLineWidth, suffixPosition), {bbox: bbox} = layoutData;
|
|
308
|
-
return this.cache.layoutData = layoutData, this.clearUpdateShapeTag(), this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height),
|
|
309
|
-
stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
310
|
-
}
|
|
311
231
|
updateVerticalMultilineAABBBounds(text) {
|
|
312
|
-
var _a, _b
|
|
232
|
+
var _a, _b;
|
|
313
233
|
const textTheme = this.getGraphicTheme(), textMeasure = application_1.application.graphicUtil.textMeasure;
|
|
314
234
|
let width;
|
|
315
|
-
const attribute = this.attribute, {
|
|
316
|
-
utils_1.calculateLineHeight)(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
|
|
235
|
+
const attribute = this.attribute, {maxLineWidth: maxLineWidth = textTheme.maxLineWidth, ellipsis: ellipsis = textTheme.ellipsis, fontFamily: fontFamily = textTheme.fontFamily, fontSize: fontSize = textTheme.fontSize, fontWeight: fontWeight = textTheme.fontWeight, stroke: stroke = textTheme.stroke, lineWidth: lineWidth = textTheme.lineWidth, verticalMode: verticalMode = textTheme.verticalMode, suffixPosition: suffixPosition = textTheme.suffixPosition} = attribute, lineHeight = this.getLineHeight(attribute, textTheme, 0);
|
|
317
236
|
let {textAlign: textAlign = textTheme.textAlign, textBaseline: textBaseline = textTheme.textBaseline} = attribute;
|
|
318
237
|
if (!verticalMode) {
|
|
319
238
|
const t = textAlign;
|
|
320
|
-
textAlign = null !== (
|
|
321
|
-
textBaseline = null !== (
|
|
239
|
+
textAlign = null !== (_a = Text.baselineMapAlign[textBaseline]) && void 0 !== _a ? _a : "left",
|
|
240
|
+
textBaseline = null !== (_b = Text.alignMapBaseline[t]) && void 0 !== _b ? _b : "top";
|
|
322
241
|
}
|
|
323
242
|
if (width = 0, !this.shouldUpdateShape() && this.cache) {
|
|
324
243
|
this.cache.verticalList.forEach((item => {
|
|
@@ -363,6 +282,15 @@ class Text extends graphic_1.Graphic {
|
|
|
363
282
|
return this._AABBBounds.set(dy, dx, dy + height, dx + width), stroke && this._AABBBounds.expand(lineWidth / 2),
|
|
364
283
|
this._AABBBounds;
|
|
365
284
|
}
|
|
285
|
+
getMaxWidth(theme) {
|
|
286
|
+
var _a, _b;
|
|
287
|
+
const attribute = this.attribute;
|
|
288
|
+
return null !== (_b = null !== (_a = attribute.maxLineWidth) && void 0 !== _a ? _a : attribute.maxWidth) && void 0 !== _b ? _b : theme.maxWidth;
|
|
289
|
+
}
|
|
290
|
+
getLineHeight(attribute, textTheme, buf) {
|
|
291
|
+
var _a;
|
|
292
|
+
return null !== (_a = (0, utils_1.calculateLineHeight)(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
|
|
293
|
+
}
|
|
366
294
|
needUpdateTags(keys, k = TEXT_UPDATE_TAG_KEY) {
|
|
367
295
|
return super.needUpdateTags(keys, k);
|
|
368
296
|
}
|
|
@@ -375,6 +303,12 @@ class Text extends graphic_1.Graphic {
|
|
|
375
303
|
getNoWorkAnimateAttr() {
|
|
376
304
|
return Text.NOWORK_ANIMATE_ATTR;
|
|
377
305
|
}
|
|
306
|
+
getBaselineMapAlign() {
|
|
307
|
+
return Text.baselineMapAlign;
|
|
308
|
+
}
|
|
309
|
+
getAlignMapBaseline() {
|
|
310
|
+
return Text.alignMapBaseline;
|
|
311
|
+
}
|
|
378
312
|
}
|
|
379
313
|
|
|
380
314
|
function createText(attributes) {
|