@visactor/vrender-core 0.21.0-alpha.1 → 0.21.0-alpha.10
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 +4 -2
- package/cjs/animate/Ticker/default-ticker.js +8 -5
- 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/common/path-svg.js +3 -3
- package/cjs/common/path-svg.js.map +1 -1
- package/cjs/common/simplify.js +2 -3
- package/cjs/common/simplify.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 +7 -3
- package/cjs/core/contributions/textMeasure/layout.js +40 -39
- 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/core/window.js +3 -2
- package/cjs/core/window.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/builtin-symbol/arrow.js +2 -2
- package/cjs/graphic/builtin-symbol/arrow.js.map +1 -1
- package/cjs/graphic/builtin-symbol/arrow2-down.js +2 -2
- package/cjs/graphic/builtin-symbol/arrow2-down.js.map +1 -1
- package/cjs/graphic/builtin-symbol/arrow2-left.js +2 -2
- package/cjs/graphic/builtin-symbol/arrow2-left.js.map +1 -1
- package/cjs/graphic/builtin-symbol/arrow2-right.js +2 -2
- package/cjs/graphic/builtin-symbol/arrow2-right.js.map +1 -1
- package/cjs/graphic/builtin-symbol/arrow2-up.js +2 -2
- package/cjs/graphic/builtin-symbol/arrow2-up.js.map +1 -1
- package/cjs/graphic/builtin-symbol/base.d.ts +1 -0
- package/cjs/graphic/builtin-symbol/base.js +3 -0
- package/cjs/graphic/builtin-symbol/base.js.map +1 -1
- package/cjs/graphic/builtin-symbol/circle.js +3 -3
- package/cjs/graphic/builtin-symbol/circle.js.map +1 -1
- package/cjs/graphic/builtin-symbol/close.js +3 -3
- package/cjs/graphic/builtin-symbol/close.js.map +1 -1
- package/cjs/graphic/builtin-symbol/cross.js +2 -2
- package/cjs/graphic/builtin-symbol/cross.js.map +1 -1
- package/cjs/graphic/builtin-symbol/diamond.js +3 -3
- package/cjs/graphic/builtin-symbol/diamond.js.map +1 -1
- package/cjs/graphic/builtin-symbol/line-h.js +3 -3
- package/cjs/graphic/builtin-symbol/line-h.js.map +1 -1
- package/cjs/graphic/builtin-symbol/line-v.js +3 -3
- package/cjs/graphic/builtin-symbol/line-v.js.map +1 -1
- package/cjs/graphic/builtin-symbol/square.js +2 -2
- package/cjs/graphic/builtin-symbol/square.js.map +1 -1
- package/cjs/graphic/builtin-symbol/star.js +2 -2
- package/cjs/graphic/builtin-symbol/star.js.map +1 -1
- package/cjs/graphic/builtin-symbol/stroke.js +2 -2
- package/cjs/graphic/builtin-symbol/stroke.js.map +1 -1
- package/cjs/graphic/builtin-symbol/thin-triangle.js +2 -2
- package/cjs/graphic/builtin-symbol/thin-triangle.js.map +1 -1
- package/cjs/graphic/builtin-symbol/triangle-down.js +2 -2
- package/cjs/graphic/builtin-symbol/triangle-down.js.map +1 -1
- package/cjs/graphic/builtin-symbol/triangle-left.js +2 -2
- package/cjs/graphic/builtin-symbol/triangle-left.js.map +1 -1
- package/cjs/graphic/builtin-symbol/triangle-right.js +2 -2
- package/cjs/graphic/builtin-symbol/triangle-right.js.map +1 -1
- package/cjs/graphic/builtin-symbol/triangle-up.js +2 -2
- package/cjs/graphic/builtin-symbol/triangle-up.js.map +1 -1
- package/cjs/graphic/builtin-symbol/utils.d.ts +1 -0
- package/cjs/graphic/builtin-symbol/utils.js +6 -3
- package/cjs/graphic/builtin-symbol/utils.js.map +1 -1
- package/cjs/graphic/builtin-symbol/wedge.js +2 -2
- package/cjs/graphic/builtin-symbol/wedge.js.map +1 -1
- package/cjs/graphic/builtin-symbol/wye.js +2 -2
- package/cjs/graphic/builtin-symbol/wye.js.map +1 -1
- package/cjs/graphic/config.d.ts +1 -1
- package/cjs/graphic/config.js +8 -3
- package/cjs/graphic/config.js.map +1 -1
- package/cjs/graphic/richtext/paragraph.js +3 -1
- package/cjs/graphic/richtext/paragraph.js.map +1 -1
- package/cjs/graphic/text.d.ts +11 -11
- package/cjs/graphic/text.js +99 -170
- package/cjs/graphic/text.js.map +1 -1
- package/cjs/graphic/wrap-text.js +12 -4
- package/cjs/graphic/wrap-text.js.map +1 -1
- package/cjs/interface/animate.d.ts +3 -1
- 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 +9 -3
- package/cjs/interface/graphic/text.js +6 -1
- package/cjs/interface/graphic/text.js.map +1 -1
- package/cjs/interface/graphic.d.ts +2 -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/arc-render.js +30 -18
- package/cjs/render/contributions/render/arc-render.js.map +1 -1
- package/cjs/render/contributions/render/area-render.js +40 -36
- package/cjs/render/contributions/render/area-render.js.map +1 -1
- package/cjs/render/contributions/render/circle-render.js +10 -5
- package/cjs/render/contributions/render/circle-render.js.map +1 -1
- 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/group-render.js +10 -5
- package/cjs/render/contributions/render/group-render.js.map +1 -1
- package/cjs/render/contributions/render/image-render.js +26 -22
- package/cjs/render/contributions/render/image-render.js.map +1 -1
- package/cjs/render/contributions/render/path-render.js +10 -5
- package/cjs/render/contributions/render/path-render.js.map +1 -1
- package/cjs/render/contributions/render/polygon-render.js +10 -5
- package/cjs/render/contributions/render/polygon-render.js.map +1 -1
- package/cjs/render/contributions/render/rect-render.js +10 -5
- package/cjs/render/contributions/render/rect-render.js.map +1 -1
- package/cjs/render/contributions/render/symbol-render.js +18 -8
- package/cjs/render/contributions/render/symbol-render.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 +1009 -818
- package/es/animate/Ticker/default-ticker.d.ts +4 -2
- package/es/animate/Ticker/default-ticker.js +9 -6
- 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/common/path-svg.js +3 -3
- package/es/common/path-svg.js.map +1 -1
- package/es/common/simplify.js +2 -3
- package/es/common/simplify.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 +7 -3
- package/es/core/contributions/textMeasure/layout.js +40 -39
- 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/core/window.js +3 -1
- package/es/core/window.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/builtin-symbol/arrow.js +2 -2
- package/es/graphic/builtin-symbol/arrow.js.map +1 -1
- package/es/graphic/builtin-symbol/arrow2-down.js +2 -2
- package/es/graphic/builtin-symbol/arrow2-down.js.map +1 -1
- package/es/graphic/builtin-symbol/arrow2-left.js +2 -2
- package/es/graphic/builtin-symbol/arrow2-left.js.map +1 -1
- package/es/graphic/builtin-symbol/arrow2-right.js +2 -2
- package/es/graphic/builtin-symbol/arrow2-right.js.map +1 -1
- package/es/graphic/builtin-symbol/arrow2-up.js +2 -2
- package/es/graphic/builtin-symbol/arrow2-up.js.map +1 -1
- package/es/graphic/builtin-symbol/base.d.ts +1 -0
- package/es/graphic/builtin-symbol/base.js +3 -0
- package/es/graphic/builtin-symbol/base.js.map +1 -1
- package/es/graphic/builtin-symbol/circle.js +3 -3
- package/es/graphic/builtin-symbol/circle.js.map +1 -1
- package/es/graphic/builtin-symbol/close.js +3 -3
- package/es/graphic/builtin-symbol/close.js.map +1 -1
- package/es/graphic/builtin-symbol/cross.js +2 -2
- package/es/graphic/builtin-symbol/cross.js.map +1 -1
- package/es/graphic/builtin-symbol/diamond.js +3 -3
- package/es/graphic/builtin-symbol/diamond.js.map +1 -1
- package/es/graphic/builtin-symbol/line-h.js +3 -3
- package/es/graphic/builtin-symbol/line-h.js.map +1 -1
- package/es/graphic/builtin-symbol/line-v.js +3 -3
- package/es/graphic/builtin-symbol/line-v.js.map +1 -1
- package/es/graphic/builtin-symbol/square.js +2 -2
- package/es/graphic/builtin-symbol/square.js.map +1 -1
- package/es/graphic/builtin-symbol/star.js +2 -2
- package/es/graphic/builtin-symbol/star.js.map +1 -1
- package/es/graphic/builtin-symbol/stroke.js +2 -2
- package/es/graphic/builtin-symbol/stroke.js.map +1 -1
- package/es/graphic/builtin-symbol/thin-triangle.js +2 -2
- package/es/graphic/builtin-symbol/thin-triangle.js.map +1 -1
- package/es/graphic/builtin-symbol/triangle-down.js +2 -2
- package/es/graphic/builtin-symbol/triangle-down.js.map +1 -1
- package/es/graphic/builtin-symbol/triangle-left.js +2 -2
- package/es/graphic/builtin-symbol/triangle-left.js.map +1 -1
- package/es/graphic/builtin-symbol/triangle-right.js +2 -2
- package/es/graphic/builtin-symbol/triangle-right.js.map +1 -1
- package/es/graphic/builtin-symbol/triangle-up.js +2 -2
- package/es/graphic/builtin-symbol/triangle-up.js.map +1 -1
- package/es/graphic/builtin-symbol/utils.d.ts +1 -0
- package/es/graphic/builtin-symbol/utils.js +7 -4
- package/es/graphic/builtin-symbol/utils.js.map +1 -1
- package/es/graphic/builtin-symbol/wedge.js +2 -2
- package/es/graphic/builtin-symbol/wedge.js.map +1 -1
- package/es/graphic/builtin-symbol/wye.js +2 -2
- package/es/graphic/builtin-symbol/wye.js.map +1 -1
- package/es/graphic/config.d.ts +1 -1
- package/es/graphic/config.js +9 -2
- package/es/graphic/config.js.map +1 -1
- package/es/graphic/richtext/paragraph.js +4 -2
- package/es/graphic/richtext/paragraph.js.map +1 -1
- package/es/graphic/text.d.ts +11 -11
- package/es/graphic/text.js +98 -165
- package/es/graphic/text.js.map +1 -1
- package/es/graphic/wrap-text.js +12 -4
- package/es/graphic/wrap-text.js.map +1 -1
- package/es/interface/animate.d.ts +3 -1
- 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 +9 -3
- package/es/interface/graphic/text.js +6 -1
- package/es/interface/graphic/text.js.map +1 -1
- package/es/interface/graphic.d.ts +2 -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/arc-render.js +30 -18
- package/es/render/contributions/render/arc-render.js.map +1 -1
- package/es/render/contributions/render/area-render.js +40 -36
- package/es/render/contributions/render/area-render.js.map +1 -1
- package/es/render/contributions/render/circle-render.js +10 -5
- package/es/render/contributions/render/circle-render.js.map +1 -1
- 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/group-render.js +10 -5
- package/es/render/contributions/render/group-render.js.map +1 -1
- package/es/render/contributions/render/image-render.js +26 -22
- package/es/render/contributions/render/image-render.js.map +1 -1
- package/es/render/contributions/render/path-render.js +10 -5
- package/es/render/contributions/render/path-render.js.map +1 -1
- package/es/render/contributions/render/polygon-render.js +10 -5
- package/es/render/contributions/render/polygon-render.js.map +1 -1
- package/es/render/contributions/render/rect-render.js +10 -5
- package/es/render/contributions/render/rect-render.js.map +1 -1
- package/es/render/contributions/render/symbol-render.js +18 -8
- package/es/render/contributions/render/symbol-render.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 +6 -5
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { tau, halfPi as halfPi$1, AABBBounds, degreeToRadian, PointService, Point, abs, max, min, atan2, epsilon, Matrix, pi2, Logger, isPointInLine, pi, TextMeasure, EventEmitter, isBoolean, isObject, isFunction, isString, has, isUndefined, isArray, cos, sin, pointAt, isNumber, getDecimalPlaces, isValidNumber, clamp, getAngleByPoint,
|
|
1
|
+
import { tau, halfPi as halfPi$1, AABBBounds, degreeToRadian, PointService, Point, abs, max, min, atan2, epsilon, Matrix, pi2, Logger, isPointInLine, pi, isNumberClose, TextMeasure, EventEmitter, isBoolean, isObject, isFunction, isString, has, isUndefined, isArray, cos, sin, pointAt, isNumber, getDecimalPlaces, isValidNumber, clamp, getAngleByPoint, isNil, Bounds, getIntersectPoint, Color, DEFAULT_COLORS, OBBBounds, normalTransform, isValidUrl, isBase64, acos, sqrt, LRU, lowerCamelCaseToMiddle, isValid, transformBoundsWithMatrix, arrayEqual, getContextFont, rotatePoint, clampAngleByRadian, asin, getRectIntersect, isRectIntersect, merge, calculateAnchorOfBounds, styleStringToObject } from '@visactor/vutils';
|
|
2
2
|
|
|
3
3
|
class Generator {
|
|
4
4
|
static GenAutoIncrementId() {
|
|
@@ -1156,6 +1156,32 @@ DefaultGlobal = __decorate([
|
|
|
1156
1156
|
__metadata("design:paramtypes", [Object])
|
|
1157
1157
|
], DefaultGlobal);
|
|
1158
1158
|
|
|
1159
|
+
var params;
|
|
1160
|
+
(function (params) {
|
|
1161
|
+
params[params["W"] = 1] = "W";
|
|
1162
|
+
params[params["H"] = 2] = "H";
|
|
1163
|
+
params[params["WH"] = 3] = "WH";
|
|
1164
|
+
})(params || (params = {}));
|
|
1165
|
+
|
|
1166
|
+
var MeasureModeEnum;
|
|
1167
|
+
(function (MeasureModeEnum) {
|
|
1168
|
+
MeasureModeEnum[MeasureModeEnum["estimate"] = 0] = "estimate";
|
|
1169
|
+
MeasureModeEnum[MeasureModeEnum["actualBounding"] = 1] = "actualBounding";
|
|
1170
|
+
MeasureModeEnum[MeasureModeEnum["fontBounding"] = 2] = "fontBounding";
|
|
1171
|
+
})(MeasureModeEnum || (MeasureModeEnum = {}));
|
|
1172
|
+
|
|
1173
|
+
const strCommandMap = [
|
|
1174
|
+
'arc',
|
|
1175
|
+
'arcTo',
|
|
1176
|
+
'bezierCurveTo',
|
|
1177
|
+
'closePath',
|
|
1178
|
+
'ellipse',
|
|
1179
|
+
'lineTo',
|
|
1180
|
+
'moveTo',
|
|
1181
|
+
'quadraticCurveTo',
|
|
1182
|
+
'rect'
|
|
1183
|
+
];
|
|
1184
|
+
|
|
1159
1185
|
const circleThreshold = tau - 1e-8;
|
|
1160
1186
|
class BoundsContext {
|
|
1161
1187
|
constructor(bounds) {
|
|
@@ -1351,12 +1377,19 @@ function parseSvgPath(str) {
|
|
|
1351
1377
|
standardCommandLen = commandLengths[commandChar];
|
|
1352
1378
|
if (currCommandData.length - 1 > standardCommandLen) {
|
|
1353
1379
|
let subCommand;
|
|
1380
|
+
let bestCommandChar = commandChar;
|
|
1354
1381
|
for (let i = 1, len = currCommandData.length; i < len; i += standardCommandLen) {
|
|
1355
|
-
subCommand = [
|
|
1382
|
+
subCommand = [bestCommandChar];
|
|
1356
1383
|
for (let j = i, subLen = i + standardCommandLen; j < subLen; j++) {
|
|
1357
1384
|
subCommand.push(currCommandData[j]);
|
|
1358
1385
|
}
|
|
1359
1386
|
result.push(subCommand);
|
|
1387
|
+
if (bestCommandChar === 'm') {
|
|
1388
|
+
bestCommandChar = 'l';
|
|
1389
|
+
}
|
|
1390
|
+
else if (bestCommandChar === 'M') {
|
|
1391
|
+
bestCommandChar = 'L';
|
|
1392
|
+
}
|
|
1360
1393
|
}
|
|
1361
1394
|
}
|
|
1362
1395
|
else {
|
|
@@ -3009,6 +3042,7 @@ const DefaultStrokeStyle = Object.assign({ outerBorder: Object.assign(Object.ass
|
|
|
3009
3042
|
const DefaultTextStyle = {
|
|
3010
3043
|
text: '',
|
|
3011
3044
|
maxLineWidth: Infinity,
|
|
3045
|
+
maxWidth: Infinity,
|
|
3012
3046
|
textAlign: 'left',
|
|
3013
3047
|
textBaseline: 'alphabetic',
|
|
3014
3048
|
fontSize: 16,
|
|
@@ -3033,7 +3067,8 @@ const DefaultTextStyle = {
|
|
|
3033
3067
|
suffixPosition: 'end',
|
|
3034
3068
|
underlineDash: [],
|
|
3035
3069
|
underlineOffset: 0,
|
|
3036
|
-
disableAutoClipedPoptip: undefined
|
|
3070
|
+
disableAutoClipedPoptip: undefined,
|
|
3071
|
+
measureMode: MeasureModeEnum.fontBounding
|
|
3037
3072
|
};
|
|
3038
3073
|
const DefaultPickStyle = {
|
|
3039
3074
|
pickStrokeBuffer: 0
|
|
@@ -3048,7 +3083,7 @@ const DefaultConnectAttribute = {
|
|
|
3048
3083
|
const DefaultDebugAttribute = {
|
|
3049
3084
|
_debug_bounds: false
|
|
3050
3085
|
};
|
|
3051
|
-
const DefaultAttribute = Object.assign(Object.assign(Object.assign({ strokeSeg: null, renderable: true, pickable: true, shadowGraphic: undefined, childrenPickable: true, fillPickable: true, strokePickable: true, visible: true, zIndex: 0, layout: null, boundsPadding: 0, renderStyle: 'default', pickMode: 'accurate', customPickShape: null, boundsMode: 'accurate', keepDirIn3d: true, shadowRootIdx: 1, globalZIndex: 1, globalCompositeOperation: '', overflow: 'hidden', shadowPickMode: 'graphic' }, DefaultDebugAttribute), DefaultStyle), DefaultTransform);
|
|
3086
|
+
const DefaultAttribute = Object.assign(Object.assign(Object.assign({ strokeSeg: null, renderable: true, pickable: true, shadowGraphic: undefined, childrenPickable: true, fillPickable: true, strokePickable: true, visible: true, zIndex: 0, layout: null, boundsPadding: 0, fillStrokeOrder: 0, renderStyle: 'default', pickMode: 'accurate', customPickShape: null, boundsMode: 'accurate', keepDirIn3d: true, shadowRootIdx: 1, globalZIndex: 1, globalCompositeOperation: '', overflow: 'hidden', shadowPickMode: 'graphic', keepStrokeScale: false }, DefaultDebugAttribute), DefaultStyle), DefaultTransform);
|
|
3052
3087
|
function addAttributeToPrototype(obj, c, keys) {
|
|
3053
3088
|
keys.forEach(key => {
|
|
3054
3089
|
c.prototype[key] = obj[key];
|
|
@@ -3063,7 +3098,7 @@ const DefaultCircleAttribute = Object.assign(Object.assign({}, DefaultAttribute)
|
|
|
3063
3098
|
const DefaultGroupAttribute = Object.assign(Object.assign({}, DefaultAttribute), { width: 0, height: 0, cornerRadius: 0, path: [], clip: false, visibleAll: true, display: 'relative', flexDirection: 'row', flexWrap: 'wrap', justifyContent: 'flex-start', alignItems: 'flex-start', alignContent: 'flex-start', baseOpacity: 1 });
|
|
3064
3099
|
const DefaultGlyphAttribute = Object.assign(Object.assign({}, DefaultAttribute), { path: '', width: 0, height: 0, cornerRadius: 0, clip: false });
|
|
3065
3100
|
const DefaultLineAttribute = Object.assign(Object.assign(Object.assign({}, DefaultAttribute), DefaultConnectAttribute), { points: [], segments: [], curveType: 'linear', clipRange: 1, clipRangeByDimension: 'default', closePath: false, curveTension: 1 });
|
|
3066
|
-
const DefaultPathAttribute = Object.assign(Object.assign({}, DefaultAttribute), { path: new CustomPath2D(), customPath: () => {
|
|
3101
|
+
const DefaultPathAttribute = Object.assign(Object.assign({}, DefaultAttribute), { path: new CustomPath2D(), fillStrokeOrder: 1, customPath: () => {
|
|
3067
3102
|
Logger.getInstance().warn('空函数');
|
|
3068
3103
|
} });
|
|
3069
3104
|
const DefaultPolygonAttribute = Object.assign(Object.assign({}, DefaultAttribute), { points: [], cornerRadius: 0, closePath: true });
|
|
@@ -3242,13 +3277,33 @@ let ATextMeasure = class ATextMeasure {
|
|
|
3242
3277
|
this.context = service.context;
|
|
3243
3278
|
service.bindTextMeasure(this);
|
|
3244
3279
|
}
|
|
3245
|
-
|
|
3246
|
-
if (!this.context) {
|
|
3247
|
-
return this.estimate(text, options).width;
|
|
3248
|
-
}
|
|
3280
|
+
_measureTextWithoutAlignBaseline(text, options, compatible) {
|
|
3249
3281
|
this.context.setTextStyleWithoutAlignBaseline(options);
|
|
3250
|
-
const
|
|
3251
|
-
return
|
|
3282
|
+
const metrics = this.context.measureText(text);
|
|
3283
|
+
return compatible ? this.compatibleMetrics(metrics, options) : metrics;
|
|
3284
|
+
}
|
|
3285
|
+
_measureTextWithAlignBaseline(text, options, compatible) {
|
|
3286
|
+
this.context.setTextStyle(options);
|
|
3287
|
+
const metrics = this.context.measureText(text);
|
|
3288
|
+
return compatible ? this.compatibleMetrics(metrics, options) : metrics;
|
|
3289
|
+
}
|
|
3290
|
+
compatibleMetrics(metrics, options) {
|
|
3291
|
+
if (metrics.actualBoundingBoxAscent == null ||
|
|
3292
|
+
metrics.actualBoundingBoxDescent == null ||
|
|
3293
|
+
metrics.fontBoundingBoxAscent == null ||
|
|
3294
|
+
metrics.fontBoundingBoxDescent == null) {
|
|
3295
|
+
const { ascent, descent } = this.measureTextBoundADscentEstimate(options);
|
|
3296
|
+
metrics.actualBoundingBoxAscent = ascent;
|
|
3297
|
+
metrics.actualBoundingBoxDescent = descent;
|
|
3298
|
+
metrics.fontBoundingBoxAscent = ascent;
|
|
3299
|
+
metrics.fontBoundingBoxDescent = descent;
|
|
3300
|
+
}
|
|
3301
|
+
if (metrics.actualBoundingBoxLeft == null || metrics.actualBoundingBoxRight == null) {
|
|
3302
|
+
const { left, right } = this.measureTextBoundLeftRightEstimate(options);
|
|
3303
|
+
metrics.actualBoundingBoxLeft = left;
|
|
3304
|
+
metrics.actualBoundingBoxRight = right;
|
|
3305
|
+
}
|
|
3306
|
+
return metrics;
|
|
3252
3307
|
}
|
|
3253
3308
|
estimate(text, { fontSize = DefaultTextAttribute.fontSize }) {
|
|
3254
3309
|
let eCharLen = 0;
|
|
@@ -3261,24 +3316,135 @@ let ATextMeasure = class ATextMeasure {
|
|
|
3261
3316
|
height: fontSize
|
|
3262
3317
|
};
|
|
3263
3318
|
}
|
|
3264
|
-
|
|
3319
|
+
measureTextWidth(text, options, textMeasure) {
|
|
3320
|
+
if (!this.context) {
|
|
3321
|
+
return this.estimate(text, options).width;
|
|
3322
|
+
}
|
|
3323
|
+
textMeasure = textMeasure !== null && textMeasure !== void 0 ? textMeasure : this._measureTextWithoutAlignBaseline(text, options);
|
|
3324
|
+
return textMeasure.width;
|
|
3325
|
+
}
|
|
3326
|
+
measureTextBoundsWidth(text, options, textMeasure) {
|
|
3327
|
+
if (!this.context) {
|
|
3328
|
+
return this.estimate(text, options).width;
|
|
3329
|
+
}
|
|
3330
|
+
textMeasure = textMeasure !== null && textMeasure !== void 0 ? textMeasure : this._measureTextWithoutAlignBaseline(text, options);
|
|
3331
|
+
return textMeasure.width;
|
|
3332
|
+
}
|
|
3333
|
+
measureTextBoundsLeftRight(text, options, textMeasure) {
|
|
3334
|
+
if (!this.context) {
|
|
3335
|
+
return this.measureTextBoundLeftRightEstimate(options);
|
|
3336
|
+
}
|
|
3337
|
+
textMeasure = textMeasure !== null && textMeasure !== void 0 ? textMeasure : this._measureTextWithAlignBaseline(text, options, true);
|
|
3338
|
+
return {
|
|
3339
|
+
left: textMeasure.actualBoundingBoxLeft,
|
|
3340
|
+
right: textMeasure.actualBoundingBoxRight
|
|
3341
|
+
};
|
|
3342
|
+
}
|
|
3343
|
+
measureTextPixelHeight(text, options, textMeasure) {
|
|
3265
3344
|
var _a;
|
|
3266
3345
|
if (!this.context) {
|
|
3267
3346
|
return (_a = options.fontSize) !== null && _a !== void 0 ? _a : DefaultTextStyle.fontSize;
|
|
3268
3347
|
}
|
|
3269
|
-
this.
|
|
3270
|
-
const textMeasure = this.context.measureText(text);
|
|
3348
|
+
textMeasure = textMeasure !== null && textMeasure !== void 0 ? textMeasure : this._measureTextWithoutAlignBaseline(text, options, true);
|
|
3271
3349
|
return Math.abs(textMeasure.actualBoundingBoxAscent - textMeasure.actualBoundingBoxDescent);
|
|
3272
3350
|
}
|
|
3273
|
-
|
|
3351
|
+
measureTextPixelADscent(text, options, textMeasure) {
|
|
3352
|
+
if (!this.context) {
|
|
3353
|
+
return this.measureTextBoundADscentEstimate(options);
|
|
3354
|
+
}
|
|
3355
|
+
textMeasure = textMeasure !== null && textMeasure !== void 0 ? textMeasure : this._measureTextWithAlignBaseline(text, options, true);
|
|
3356
|
+
return {
|
|
3357
|
+
ascent: textMeasure.actualBoundingBoxAscent,
|
|
3358
|
+
descent: textMeasure.actualBoundingBoxDescent
|
|
3359
|
+
};
|
|
3360
|
+
}
|
|
3361
|
+
measureTextBoundHieght(text, options, textMeasure) {
|
|
3274
3362
|
var _a;
|
|
3275
3363
|
if (!this.context) {
|
|
3276
3364
|
return (_a = options.fontSize) !== null && _a !== void 0 ? _a : DefaultTextStyle.fontSize;
|
|
3277
3365
|
}
|
|
3278
|
-
this.
|
|
3279
|
-
const textMeasure = this.context.measureText(text);
|
|
3366
|
+
textMeasure = textMeasure !== null && textMeasure !== void 0 ? textMeasure : this._measureTextWithoutAlignBaseline(text, options, true);
|
|
3280
3367
|
return Math.abs(textMeasure.fontBoundingBoxAscent - textMeasure.fontBoundingBoxDescent);
|
|
3281
3368
|
}
|
|
3369
|
+
measureTextBoundADscent(text, options, textMeasure) {
|
|
3370
|
+
if (!this.context) {
|
|
3371
|
+
return this.measureTextBoundADscentEstimate(options);
|
|
3372
|
+
}
|
|
3373
|
+
textMeasure = textMeasure !== null && textMeasure !== void 0 ? textMeasure : this._measureTextWithAlignBaseline(text, options, true);
|
|
3374
|
+
return {
|
|
3375
|
+
ascent: textMeasure.fontBoundingBoxAscent,
|
|
3376
|
+
descent: textMeasure.fontBoundingBoxDescent
|
|
3377
|
+
};
|
|
3378
|
+
}
|
|
3379
|
+
measureTextBoundADscentEstimate(options) {
|
|
3380
|
+
var _a;
|
|
3381
|
+
const fontSize = (_a = options.fontSize) !== null && _a !== void 0 ? _a : DefaultTextStyle.fontSize;
|
|
3382
|
+
return {
|
|
3383
|
+
ascent: 0.79 * fontSize,
|
|
3384
|
+
descent: 0.21 * fontSize
|
|
3385
|
+
};
|
|
3386
|
+
}
|
|
3387
|
+
measureTextBoundLeftRightEstimate(options) {
|
|
3388
|
+
var _a;
|
|
3389
|
+
const fontSize = (_a = options.fontSize) !== null && _a !== void 0 ? _a : DefaultTextStyle.fontSize;
|
|
3390
|
+
const { textAlign } = options;
|
|
3391
|
+
if (textAlign === 'center') {
|
|
3392
|
+
return {
|
|
3393
|
+
left: fontSize / 2,
|
|
3394
|
+
right: fontSize / 2
|
|
3395
|
+
};
|
|
3396
|
+
}
|
|
3397
|
+
else if (textAlign === 'right' || textAlign === 'end') {
|
|
3398
|
+
return {
|
|
3399
|
+
left: fontSize,
|
|
3400
|
+
right: 0
|
|
3401
|
+
};
|
|
3402
|
+
}
|
|
3403
|
+
return {
|
|
3404
|
+
left: 0,
|
|
3405
|
+
right: fontSize
|
|
3406
|
+
};
|
|
3407
|
+
}
|
|
3408
|
+
measureTextPixelADscentAndWidth(text, options, mode) {
|
|
3409
|
+
if (!this.context) {
|
|
3410
|
+
return Object.assign(Object.assign({}, this.measureTextBoundADscentEstimate(options)), { width: this.estimate(text, options).width });
|
|
3411
|
+
}
|
|
3412
|
+
const out = this._measureTextWithoutAlignBaseline(text, options, true);
|
|
3413
|
+
if (mode === MeasureModeEnum.actualBounding) {
|
|
3414
|
+
return {
|
|
3415
|
+
ascent: out.actualBoundingBoxAscent,
|
|
3416
|
+
descent: out.actualBoundingBoxDescent,
|
|
3417
|
+
width: out.width
|
|
3418
|
+
};
|
|
3419
|
+
}
|
|
3420
|
+
else if (mode === MeasureModeEnum.estimate) {
|
|
3421
|
+
return Object.assign(Object.assign({}, this.measureTextBoundADscentEstimate(options)), { width: out.width });
|
|
3422
|
+
}
|
|
3423
|
+
else if (mode === MeasureModeEnum.fontBounding) {
|
|
3424
|
+
let ascent = out.fontBoundingBoxAscent;
|
|
3425
|
+
let descent = out.fontBoundingBoxDescent;
|
|
3426
|
+
if (out.actualBoundingBoxDescent && descent < out.actualBoundingBoxDescent) {
|
|
3427
|
+
const delta = out.actualBoundingBoxDescent - descent;
|
|
3428
|
+
descent += delta;
|
|
3429
|
+
ascent -= delta;
|
|
3430
|
+
}
|
|
3431
|
+
else if (out.actualBoundingBoxAscent && ascent < out.actualBoundingBoxAscent) {
|
|
3432
|
+
const delta = out.actualBoundingBoxAscent - ascent;
|
|
3433
|
+
ascent += delta;
|
|
3434
|
+
descent -= delta;
|
|
3435
|
+
}
|
|
3436
|
+
return {
|
|
3437
|
+
ascent,
|
|
3438
|
+
descent,
|
|
3439
|
+
width: out.width
|
|
3440
|
+
};
|
|
3441
|
+
}
|
|
3442
|
+
return {
|
|
3443
|
+
ascent: out.actualBoundingBoxAscent,
|
|
3444
|
+
descent: out.actualBoundingBoxDescent,
|
|
3445
|
+
width: out.width
|
|
3446
|
+
};
|
|
3447
|
+
}
|
|
3282
3448
|
measureText(text, options) {
|
|
3283
3449
|
if (!this.context) {
|
|
3284
3450
|
return this.estimate(text, options);
|
|
@@ -3376,6 +3542,11 @@ let ATextMeasure = class ATextMeasure {
|
|
|
3376
3542
|
return data;
|
|
3377
3543
|
}
|
|
3378
3544
|
_clipTextEnd(text, options, width, leftIdx, rightIdx) {
|
|
3545
|
+
if (leftIdx === rightIdx) {
|
|
3546
|
+
Logger.getInstance().warn(`【_clipTextEnd】不应该走到这里${text}, ${leftIdx}, ${rightIdx}`);
|
|
3547
|
+
const subText = text.substring(0, rightIdx + 1);
|
|
3548
|
+
return { str: subText, width: this.measureTextWidth(subText, options) };
|
|
3549
|
+
}
|
|
3379
3550
|
const middleIdx = Math.floor((leftIdx + rightIdx) / 2);
|
|
3380
3551
|
const subText = text.substring(0, middleIdx + 1);
|
|
3381
3552
|
const strWidth = this.measureTextWidth(subText, options);
|
|
@@ -3406,25 +3577,25 @@ let ATextMeasure = class ATextMeasure {
|
|
|
3406
3577
|
}
|
|
3407
3578
|
_clipTextStart(text, options, width, leftIdx, rightIdx) {
|
|
3408
3579
|
const middleIdx = Math.ceil((leftIdx + rightIdx) / 2);
|
|
3409
|
-
const subText = text.substring(middleIdx - 1, text.length
|
|
3580
|
+
const subText = text.substring(middleIdx - 1, text.length);
|
|
3410
3581
|
const strWidth = this.measureTextWidth(subText, options);
|
|
3411
3582
|
let length;
|
|
3412
3583
|
if (strWidth > width) {
|
|
3413
3584
|
if (subText.length <= 1) {
|
|
3414
3585
|
return { str: '', width: 0 };
|
|
3415
3586
|
}
|
|
3416
|
-
const str = text.substring(middleIdx, text.length
|
|
3587
|
+
const str = text.substring(middleIdx, text.length);
|
|
3417
3588
|
length = this.measureTextWidth(str, options);
|
|
3418
3589
|
if (length <= width) {
|
|
3419
3590
|
return { str, width: length };
|
|
3420
3591
|
}
|
|
3421
|
-
return this._clipTextStart(text, options, width, middleIdx, text.length
|
|
3592
|
+
return this._clipTextStart(text, options, width, middleIdx, text.length);
|
|
3422
3593
|
}
|
|
3423
3594
|
else if (strWidth < width) {
|
|
3424
3595
|
if (middleIdx <= 0) {
|
|
3425
3596
|
return { str: text, width: this.measureTextWidth(text, options) };
|
|
3426
3597
|
}
|
|
3427
|
-
const str = text.substring(middleIdx - 2, text.length
|
|
3598
|
+
const str = text.substring(middleIdx - 2, text.length);
|
|
3428
3599
|
length = this.measureTextWidth(str, options);
|
|
3429
3600
|
if (length >= width) {
|
|
3430
3601
|
return { str: subText, width: strWidth };
|
|
@@ -4446,8 +4617,8 @@ let DefaultWindow = class DefaultWindow {
|
|
|
4446
4617
|
const viewBox = this._handler.getViewBox();
|
|
4447
4618
|
return !(viewBox.x1 === 0 &&
|
|
4448
4619
|
viewBox.y1 === 0 &&
|
|
4449
|
-
this.width
|
|
4450
|
-
this.height
|
|
4620
|
+
isNumberClose(this.width, viewBox.width()) &&
|
|
4621
|
+
isNumberClose(this.height, viewBox.height()));
|
|
4451
4622
|
}
|
|
4452
4623
|
isVisible(bbox) {
|
|
4453
4624
|
return this._handler.isVisible(bbox);
|
|
@@ -5944,7 +6115,7 @@ class EventManager {
|
|
|
5944
6115
|
this.dispatchEvent(clickEvent, 'dblclick');
|
|
5945
6116
|
}
|
|
5946
6117
|
}
|
|
5947
|
-
else if (clickEvent.pointerType === 'touch') {
|
|
6118
|
+
else if (clickEvent.pointerType === 'touch' && this._config.supportsTouchEvents) {
|
|
5948
6119
|
this.dispatchEvent(clickEvent, 'tap');
|
|
5949
6120
|
if (clickHistory.clickCount === 2) {
|
|
5950
6121
|
this.dispatchEvent(clickEvent, 'dbltap');
|
|
@@ -6403,7 +6574,8 @@ class EventSystem {
|
|
|
6403
6574
|
};
|
|
6404
6575
|
const { targetElement, resolution, rootNode, global, autoPreventDefault = false, clickInterval, supportsTouchEvents = global.supportsTouchEvents, supportsPointerEvents = global.supportsPointerEvents } = params;
|
|
6405
6576
|
this.manager = new EventManager(rootNode, {
|
|
6406
|
-
clickInterval
|
|
6577
|
+
clickInterval,
|
|
6578
|
+
supportsTouchEvents: supportsTouchEvents
|
|
6407
6579
|
});
|
|
6408
6580
|
this.globalObj = global;
|
|
6409
6581
|
this.supportsPointerEvents = supportsPointerEvents;
|
|
@@ -6828,7 +7000,7 @@ class TimeOutTickHandler {
|
|
|
6828
7000
|
}
|
|
6829
7001
|
}
|
|
6830
7002
|
|
|
6831
|
-
class DefaultTicker {
|
|
7003
|
+
class DefaultTicker extends EventEmitter {
|
|
6832
7004
|
set mode(m) {
|
|
6833
7005
|
if (this._mode === m) {
|
|
6834
7006
|
return;
|
|
@@ -6840,18 +7012,19 @@ class DefaultTicker {
|
|
|
6840
7012
|
return this._mode;
|
|
6841
7013
|
}
|
|
6842
7014
|
constructor(timelines = []) {
|
|
7015
|
+
super();
|
|
6843
7016
|
this.handleTick = (handler, params) => {
|
|
6844
7017
|
const { once = false } = params !== null && params !== void 0 ? params : {};
|
|
6845
7018
|
if (this.ifCanStop()) {
|
|
6846
7019
|
this.stop();
|
|
6847
7020
|
return;
|
|
6848
7021
|
}
|
|
6849
|
-
this._handlerTick(
|
|
7022
|
+
this._handlerTick();
|
|
6850
7023
|
if (!once) {
|
|
6851
7024
|
handler.tick(this.interval, this.handleTick);
|
|
6852
7025
|
}
|
|
6853
7026
|
};
|
|
6854
|
-
this._handlerTick = (
|
|
7027
|
+
this._handlerTick = () => {
|
|
6855
7028
|
const tickerHandler = this.tickerHandler;
|
|
6856
7029
|
const time = tickerHandler.getTime();
|
|
6857
7030
|
let delta = 0;
|
|
@@ -6866,6 +7039,7 @@ class DefaultTicker {
|
|
|
6866
7039
|
this.timelines.forEach(t => {
|
|
6867
7040
|
t.tick(delta);
|
|
6868
7041
|
});
|
|
7042
|
+
this.emit('afterTick');
|
|
6869
7043
|
};
|
|
6870
7044
|
this.init();
|
|
6871
7045
|
this.lastFrameTime = -1;
|
|
@@ -7005,6 +7179,11 @@ class DefaultTicker {
|
|
|
7005
7179
|
this.setupTickHandler();
|
|
7006
7180
|
this.lastFrameTime = -1;
|
|
7007
7181
|
}
|
|
7182
|
+
trySyncTickStatus() {
|
|
7183
|
+
if (this.status === STATUS$1.RUNNING) {
|
|
7184
|
+
this._handlerTick();
|
|
7185
|
+
}
|
|
7186
|
+
}
|
|
7008
7187
|
}
|
|
7009
7188
|
|
|
7010
7189
|
class ManualTickHandler {
|
|
@@ -8825,6 +9004,11 @@ class TagPointsUpdate extends ACustomAnimate {
|
|
|
8825
9004
|
this.clipRange =
|
|
8826
9005
|
this.toPoints[lastMatchedIndex][this.clipRangeByDimension] /
|
|
8827
9006
|
this.toPoints[this.toPoints.length - 1][this.clipRangeByDimension];
|
|
9007
|
+
if (this.clipRange === 1) {
|
|
9008
|
+
this.shrinkClipRange =
|
|
9009
|
+
this.toPoints[lastMatchedIndex][this.clipRangeByDimension] /
|
|
9010
|
+
this.fromPoints[this.fromPoints.length - 1][this.clipRangeByDimension];
|
|
9011
|
+
}
|
|
8828
9012
|
if (!isValidNumber(this.clipRange)) {
|
|
8829
9013
|
this.clipRange = 0;
|
|
8830
9014
|
}
|
|
@@ -8864,6 +9048,12 @@ class TagPointsUpdate extends ACustomAnimate {
|
|
|
8864
9048
|
return newPoint;
|
|
8865
9049
|
});
|
|
8866
9050
|
}
|
|
9051
|
+
onFirstRun() {
|
|
9052
|
+
const lastClipRange = this.target.attribute.clipRange;
|
|
9053
|
+
if (isValidNumber(lastClipRange * this.clipRange)) {
|
|
9054
|
+
this.clipRange *= lastClipRange;
|
|
9055
|
+
}
|
|
9056
|
+
}
|
|
8867
9057
|
onUpdate(end, ratio, out) {
|
|
8868
9058
|
this.points = this.points.map((point, index) => {
|
|
8869
9059
|
const newPoint = pointInterpolation(this.interpolatePoints[index][0], this.interpolatePoints[index][1], ratio);
|
|
@@ -8871,6 +9061,17 @@ class TagPointsUpdate extends ACustomAnimate {
|
|
|
8871
9061
|
return newPoint;
|
|
8872
9062
|
});
|
|
8873
9063
|
if (this.clipRange) {
|
|
9064
|
+
if (this.shrinkClipRange) {
|
|
9065
|
+
if (!end) {
|
|
9066
|
+
out.points = this.fromPoints;
|
|
9067
|
+
out.clipRange = this.clipRange - (this.clipRange - this.shrinkClipRange) * ratio;
|
|
9068
|
+
}
|
|
9069
|
+
else {
|
|
9070
|
+
out.points = this.toPoints;
|
|
9071
|
+
out.clipRange = 1;
|
|
9072
|
+
}
|
|
9073
|
+
return;
|
|
9074
|
+
}
|
|
8874
9075
|
out.clipRange = this.clipRange + (1 - this.clipRange) * ratio;
|
|
8875
9076
|
}
|
|
8876
9077
|
if (this.segmentsCache && this.to.segments) {
|
|
@@ -15396,14 +15597,14 @@ class DefaultArcRenderContribution {
|
|
|
15396
15597
|
if (!(doOuterBorder || doInnerBorder)) {
|
|
15397
15598
|
return;
|
|
15398
15599
|
}
|
|
15399
|
-
const { innerPadding = arcAttribute.innerPadding, outerPadding = arcAttribute.outerPadding, startAngle = arcAttribute.startAngle, endAngle = arcAttribute.endAngle, opacity = arcAttribute.opacity, x: originX = arcAttribute.x, y: originY = arcAttribute.y, scaleX = arcAttribute.scaleX, scaleY = arcAttribute.scaleY } = arc.attribute;
|
|
15600
|
+
const { innerPadding = arcAttribute.innerPadding, outerPadding = arcAttribute.outerPadding, startAngle = arcAttribute.startAngle, endAngle = arcAttribute.endAngle, opacity = arcAttribute.opacity, x: originX = arcAttribute.x, y: originY = arcAttribute.y, scaleX = arcAttribute.scaleX, scaleY = arcAttribute.scaleY, keepStrokeScale = arcAttribute.keepStrokeScale } = arc.attribute;
|
|
15400
15601
|
let { innerRadius = arcAttribute.innerRadius, outerRadius = arcAttribute.outerRadius } = arc.attribute;
|
|
15401
15602
|
outerRadius += outerPadding;
|
|
15402
15603
|
innerRadius -= innerPadding;
|
|
15403
15604
|
const renderBorder = (borderStyle, key) => {
|
|
15404
15605
|
const doStroke = !!(borderStyle && borderStyle.stroke);
|
|
15405
15606
|
const { distance = arcAttribute[key].distance } = borderStyle;
|
|
15406
|
-
const d = getScaledStroke(context, distance, context.dpr);
|
|
15607
|
+
const d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr);
|
|
15407
15608
|
const deltaAngle = distance / outerRadius;
|
|
15408
15609
|
const sign = key === 'outerBorder' ? 1 : -1;
|
|
15409
15610
|
arc.setAttributes({
|
|
@@ -15448,11 +15649,11 @@ class DefaultCircleRenderContribution {
|
|
|
15448
15649
|
if (!(doOuterBorder || doInnerBorder)) {
|
|
15449
15650
|
return;
|
|
15450
15651
|
}
|
|
15451
|
-
const { radius = circleAttribute.radius, startAngle = circleAttribute.startAngle, endAngle = circleAttribute.endAngle, opacity = circleAttribute.opacity, x: originX = circleAttribute.x, y: originY = circleAttribute.y, scaleX = circleAttribute.scaleX, scaleY = circleAttribute.scaleY } = circle.attribute;
|
|
15652
|
+
const { radius = circleAttribute.radius, startAngle = circleAttribute.startAngle, endAngle = circleAttribute.endAngle, opacity = circleAttribute.opacity, x: originX = circleAttribute.x, y: originY = circleAttribute.y, scaleX = circleAttribute.scaleX, scaleY = circleAttribute.scaleY, keepStrokeScale = circleAttribute.keepStrokeScale } = circle.attribute;
|
|
15452
15653
|
const renderBorder = (borderStyle, key) => {
|
|
15453
15654
|
const doStroke = !!(borderStyle && borderStyle.stroke);
|
|
15454
15655
|
const { distance = circleAttribute[key].distance } = borderStyle;
|
|
15455
|
-
const d = getScaledStroke(context, distance, context.dpr);
|
|
15656
|
+
const d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr);
|
|
15456
15657
|
const sign = key === 'outerBorder' ? 1 : -1;
|
|
15457
15658
|
context.beginPath();
|
|
15458
15659
|
context.arc(x, y, radius + sign * d, startAngle, endAngle);
|
|
@@ -15637,7 +15838,7 @@ class DefaultRectRenderContribution {
|
|
|
15637
15838
|
if (!(doOuterBorder || doInnerBorder)) {
|
|
15638
15839
|
return;
|
|
15639
15840
|
}
|
|
15640
|
-
const { cornerRadius = rectAttribute.cornerRadius, opacity = rectAttribute.opacity, x: originX = rectAttribute.x, y: originY = rectAttribute.y, scaleX = rectAttribute.scaleX, scaleY = rectAttribute.scaleY, x1, y1 } = rect.attribute;
|
|
15841
|
+
const { cornerRadius = rectAttribute.cornerRadius, opacity = rectAttribute.opacity, x: originX = rectAttribute.x, y: originY = rectAttribute.y, scaleX = rectAttribute.scaleX, scaleY = rectAttribute.scaleY, x1, y1, keepStrokeScale = rectAttribute.keepStrokeScale } = rect.attribute;
|
|
15641
15842
|
let { width, height } = rect.attribute;
|
|
15642
15843
|
width = (width !== null && width !== void 0 ? width : x1 - x) || 0;
|
|
15643
15844
|
height = (height !== null && height !== void 0 ? height : y1 - y) || 0;
|
|
@@ -15645,7 +15846,7 @@ class DefaultRectRenderContribution {
|
|
|
15645
15846
|
const doStroke = !!(borderStyle && borderStyle.stroke);
|
|
15646
15847
|
const sign = key === 'outerBorder' ? -1 : 1;
|
|
15647
15848
|
const { distance = rectAttribute[key].distance } = borderStyle;
|
|
15648
|
-
const d = getScaledStroke(context, distance, context.dpr);
|
|
15849
|
+
const d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr);
|
|
15649
15850
|
const nextX = x + sign * d;
|
|
15650
15851
|
const nextY = y + sign * d;
|
|
15651
15852
|
const dw = d * 2;
|
|
@@ -15885,11 +16086,11 @@ class DefaultSymbolRenderContribution {
|
|
|
15885
16086
|
if (!(doOuterBorder || doInnerBorder)) {
|
|
15886
16087
|
return;
|
|
15887
16088
|
}
|
|
15888
|
-
const { size = symbolAttribute.size, opacity = symbolAttribute.opacity, x: originX = symbolAttribute.x, y: originY = symbolAttribute.y, scaleX = symbolAttribute.scaleX, scaleY = symbolAttribute.scaleY } = symbol.attribute;
|
|
16089
|
+
const { size = symbolAttribute.size, opacity = symbolAttribute.opacity, x: originX = symbolAttribute.x, y: originY = symbolAttribute.y, scaleX = symbolAttribute.scaleX, scaleY = symbolAttribute.scaleY, keepStrokeScale = symbolAttribute.keepStrokeScale } = symbol.attribute;
|
|
15889
16090
|
const renderBorder = (borderStyle, key) => {
|
|
15890
16091
|
const doStroke = !!(borderStyle && borderStyle.stroke);
|
|
15891
16092
|
const { distance = symbolAttribute[key].distance } = borderStyle;
|
|
15892
|
-
const d = getScaledStroke(context, distance, context.dpr);
|
|
16093
|
+
const d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr);
|
|
15893
16094
|
const sign = key === 'outerBorder' ? 1 : -1;
|
|
15894
16095
|
context.beginPath();
|
|
15895
16096
|
if (parsedPath.drawOffset(context, size, x, y, sign * d) === false) {
|
|
@@ -16010,7 +16211,7 @@ let DefaultCanvasArcRender = class DefaultCanvasArcRender extends BaseRender {
|
|
|
16010
16211
|
}
|
|
16011
16212
|
drawShape(arc, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
16012
16213
|
const arcAttribute = getTheme(arc, params === null || params === void 0 ? void 0 : params.theme).arc;
|
|
16013
|
-
const { fill = arcAttribute.fill, stroke = arcAttribute.stroke, x: originX = arcAttribute.x, y: originY = arcAttribute.y } = arc.attribute;
|
|
16214
|
+
const { fill = arcAttribute.fill, stroke = arcAttribute.stroke, x: originX = arcAttribute.x, y: originY = arcAttribute.y, fillStrokeOrder = arcAttribute.fillStrokeOrder } = arc.attribute;
|
|
16014
16215
|
const data = this.valid(arc, arcAttribute, fillCb, strokeCb);
|
|
16015
16216
|
if (!data) {
|
|
16016
16217
|
return;
|
|
@@ -16038,23 +16239,35 @@ let DefaultCanvasArcRender = class DefaultCanvasArcRender extends BaseRender {
|
|
|
16038
16239
|
beforeRenderContribitionsRuned = true;
|
|
16039
16240
|
context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute);
|
|
16040
16241
|
this.beforeRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb);
|
|
16041
|
-
|
|
16042
|
-
if (
|
|
16043
|
-
fillCb
|
|
16242
|
+
const _runFill = () => {
|
|
16243
|
+
if (doFill) {
|
|
16244
|
+
if (fillCb) {
|
|
16245
|
+
fillCb(context, arc.attribute, arcAttribute);
|
|
16246
|
+
}
|
|
16247
|
+
else if (fVisible) {
|
|
16248
|
+
context.setCommonStyle(arc, arc.attribute, originX - x, originY - y, arcAttribute);
|
|
16249
|
+
context.fill();
|
|
16250
|
+
}
|
|
16044
16251
|
}
|
|
16045
|
-
|
|
16046
|
-
|
|
16047
|
-
|
|
16252
|
+
};
|
|
16253
|
+
const _runStroke = () => {
|
|
16254
|
+
if (doStroke && isFullStroke) {
|
|
16255
|
+
if (strokeCb) {
|
|
16256
|
+
strokeCb(context, arc.attribute, arcAttribute);
|
|
16257
|
+
}
|
|
16258
|
+
else if (sVisible) {
|
|
16259
|
+
context.setStrokeStyle(arc, arc.attribute, originX - x, originY - y, arcAttribute);
|
|
16260
|
+
context.stroke();
|
|
16261
|
+
}
|
|
16048
16262
|
}
|
|
16263
|
+
};
|
|
16264
|
+
if (!fillStrokeOrder) {
|
|
16265
|
+
_runFill();
|
|
16266
|
+
_runStroke();
|
|
16049
16267
|
}
|
|
16050
|
-
|
|
16051
|
-
|
|
16052
|
-
|
|
16053
|
-
}
|
|
16054
|
-
else if (sVisible) {
|
|
16055
|
-
context.setStrokeStyle(arc, arc.attribute, originX - x, originY - y, arcAttribute);
|
|
16056
|
-
context.stroke();
|
|
16057
|
-
}
|
|
16268
|
+
else {
|
|
16269
|
+
_runStroke();
|
|
16270
|
+
_runFill();
|
|
16058
16271
|
}
|
|
16059
16272
|
}
|
|
16060
16273
|
if (!isFullStroke && doStroke) {
|
|
@@ -16084,24 +16297,36 @@ let DefaultCanvasArcRender = class DefaultCanvasArcRender extends BaseRender {
|
|
|
16084
16297
|
if (!beforeRenderContribitionsRuned) {
|
|
16085
16298
|
this.beforeRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb);
|
|
16086
16299
|
}
|
|
16087
|
-
|
|
16088
|
-
|
|
16089
|
-
|
|
16090
|
-
|
|
16091
|
-
|
|
16092
|
-
|
|
16093
|
-
|
|
16094
|
-
|
|
16095
|
-
|
|
16300
|
+
const _runFill = () => {
|
|
16301
|
+
if (doFill) {
|
|
16302
|
+
const color = fill;
|
|
16303
|
+
if (color.gradient === 'conical') {
|
|
16304
|
+
const lastColor = getConicGradientAt(0, 0, endAngle, color);
|
|
16305
|
+
if (fillCb) ;
|
|
16306
|
+
else if (fillVisible) {
|
|
16307
|
+
context.setCommonStyle(arc, arc.attribute, x, y, arcAttribute);
|
|
16308
|
+
context.fillStyle = lastColor;
|
|
16309
|
+
context.fill();
|
|
16310
|
+
}
|
|
16096
16311
|
}
|
|
16097
16312
|
}
|
|
16098
|
-
}
|
|
16099
|
-
|
|
16100
|
-
if (
|
|
16101
|
-
|
|
16102
|
-
|
|
16103
|
-
|
|
16313
|
+
};
|
|
16314
|
+
const _runStroke = () => {
|
|
16315
|
+
if (doStroke) {
|
|
16316
|
+
if (strokeCb) ;
|
|
16317
|
+
else if (sVisible) {
|
|
16318
|
+
context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute);
|
|
16319
|
+
context.stroke();
|
|
16320
|
+
}
|
|
16104
16321
|
}
|
|
16322
|
+
};
|
|
16323
|
+
if (!fillStrokeOrder) {
|
|
16324
|
+
_runFill();
|
|
16325
|
+
_runStroke();
|
|
16326
|
+
}
|
|
16327
|
+
else {
|
|
16328
|
+
_runFill();
|
|
16329
|
+
_runStroke();
|
|
16105
16330
|
}
|
|
16106
16331
|
}
|
|
16107
16332
|
}
|
|
@@ -16137,7 +16362,7 @@ let DefaultCanvasCircleRender = class DefaultCanvasCircleRender extends BaseRend
|
|
|
16137
16362
|
}
|
|
16138
16363
|
drawShape(circle, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
16139
16364
|
const circleAttribute = getTheme(circle, params === null || params === void 0 ? void 0 : params.theme).circle;
|
|
16140
|
-
const { radius = circleAttribute.radius, startAngle = circleAttribute.startAngle, endAngle = circleAttribute.endAngle, x: originX = circleAttribute.x, y: originY = circleAttribute.y } = circle.attribute;
|
|
16365
|
+
const { radius = circleAttribute.radius, startAngle = circleAttribute.startAngle, endAngle = circleAttribute.endAngle, x: originX = circleAttribute.x, y: originY = circleAttribute.y, fillStrokeOrder = circleAttribute.fillStrokeOrder } = circle.attribute;
|
|
16141
16366
|
const data = this.valid(circle, circleAttribute, fillCb, strokeCb);
|
|
16142
16367
|
if (!data) {
|
|
16143
16368
|
return;
|
|
@@ -16148,23 +16373,35 @@ let DefaultCanvasCircleRender = class DefaultCanvasCircleRender extends BaseRend
|
|
|
16148
16373
|
context.closePath();
|
|
16149
16374
|
context.setShadowBlendStyle && context.setShadowBlendStyle(circle, circle.attribute, circleAttribute);
|
|
16150
16375
|
this.beforeRenderStep(circle, context, x, y, doFill, doStroke, fVisible, sVisible, circleAttribute, drawContext, fillCb, strokeCb);
|
|
16151
|
-
|
|
16152
|
-
if (
|
|
16153
|
-
fillCb
|
|
16376
|
+
const _runFill = () => {
|
|
16377
|
+
if (doFill) {
|
|
16378
|
+
if (fillCb) {
|
|
16379
|
+
fillCb(context, circle.attribute, circleAttribute);
|
|
16380
|
+
}
|
|
16381
|
+
else if (fVisible) {
|
|
16382
|
+
context.setCommonStyle(circle, circle.attribute, originX - x, originY - y, circleAttribute);
|
|
16383
|
+
context.fill();
|
|
16384
|
+
}
|
|
16154
16385
|
}
|
|
16155
|
-
|
|
16156
|
-
|
|
16157
|
-
|
|
16386
|
+
};
|
|
16387
|
+
const _runStroke = () => {
|
|
16388
|
+
if (doStroke) {
|
|
16389
|
+
if (strokeCb) {
|
|
16390
|
+
strokeCb(context, circle.attribute, circleAttribute);
|
|
16391
|
+
}
|
|
16392
|
+
else if (sVisible) {
|
|
16393
|
+
context.setStrokeStyle(circle, circle.attribute, originX - x, originY - y, circleAttribute);
|
|
16394
|
+
context.stroke();
|
|
16395
|
+
}
|
|
16158
16396
|
}
|
|
16397
|
+
};
|
|
16398
|
+
if (!fillStrokeOrder) {
|
|
16399
|
+
_runFill();
|
|
16400
|
+
_runStroke();
|
|
16159
16401
|
}
|
|
16160
|
-
|
|
16161
|
-
|
|
16162
|
-
|
|
16163
|
-
}
|
|
16164
|
-
else if (sVisible) {
|
|
16165
|
-
context.setStrokeStyle(circle, circle.attribute, originX - x, originY - y, circleAttribute);
|
|
16166
|
-
context.stroke();
|
|
16167
|
-
}
|
|
16402
|
+
else {
|
|
16403
|
+
_runStroke();
|
|
16404
|
+
_runFill();
|
|
16168
16405
|
}
|
|
16169
16406
|
this.afterRenderStep(circle, context, x, y, doFill, doStroke, fVisible, sVisible, circleAttribute, drawContext, fillCb, strokeCb);
|
|
16170
16407
|
}
|
|
@@ -16922,7 +17159,7 @@ let DefaultCanvasAreaRender = class DefaultCanvasAreaRender extends BaseRender {
|
|
|
16922
17159
|
this.init(areaRenderContribitions);
|
|
16923
17160
|
}
|
|
16924
17161
|
drawLinearAreaHighPerformance(area, context, fill, stroke, fillOpacity, strokeOpacity, offsetX, offsetY, areaAttribute, drawContext, params, fillCb, strokeCb) {
|
|
16925
|
-
var _a, _b, _c
|
|
17162
|
+
var _a, _b, _c;
|
|
16926
17163
|
const { points } = area.attribute;
|
|
16927
17164
|
if (points.length < 2) {
|
|
16928
17165
|
return;
|
|
@@ -16943,44 +17180,51 @@ let DefaultCanvasAreaRender = class DefaultCanvasAreaRender extends BaseRender {
|
|
|
16943
17180
|
context.setShadowBlendStyle && context.setShadowBlendStyle(area, area.attribute, areaAttribute);
|
|
16944
17181
|
this.beforeRenderStep(area, context, offsetX, offsetY, !!fillOpacity, false, fill, false, areaAttribute, drawContext, fillCb, null, { attribute: area.attribute });
|
|
16945
17182
|
const { x: originX = 0, x: originY = 0 } = area.attribute;
|
|
16946
|
-
|
|
16947
|
-
if (
|
|
16948
|
-
fillCb
|
|
16949
|
-
|
|
16950
|
-
|
|
16951
|
-
|
|
16952
|
-
|
|
17183
|
+
const _runFill = () => {
|
|
17184
|
+
if (fill !== false) {
|
|
17185
|
+
if (fillCb) {
|
|
17186
|
+
fillCb(context, area.attribute, areaAttribute);
|
|
17187
|
+
}
|
|
17188
|
+
else if (fillOpacity) {
|
|
17189
|
+
context.setCommonStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute);
|
|
17190
|
+
context.fill();
|
|
17191
|
+
}
|
|
16953
17192
|
}
|
|
16954
|
-
}
|
|
16955
|
-
|
|
16956
|
-
|
|
16957
|
-
|
|
16958
|
-
|
|
16959
|
-
|
|
16960
|
-
|
|
16961
|
-
|
|
16962
|
-
|
|
16963
|
-
|
|
16964
|
-
|
|
17193
|
+
};
|
|
17194
|
+
const _runStroke = () => {
|
|
17195
|
+
var _a, _b;
|
|
17196
|
+
if (stroke) {
|
|
17197
|
+
const { stroke = areaAttribute && areaAttribute.stroke } = area.attribute;
|
|
17198
|
+
if (isArray(stroke) && (stroke[0] || stroke[2]) && stroke[1] === false) {
|
|
17199
|
+
context.beginPath();
|
|
17200
|
+
if (stroke[0]) {
|
|
17201
|
+
context.moveTo(startP.x + offsetX, startP.y + offsetY, z);
|
|
17202
|
+
for (let i = 1; i < points.length; i++) {
|
|
17203
|
+
const p = points[i];
|
|
17204
|
+
context.lineTo(p.x + offsetX, p.y + offsetY, z);
|
|
17205
|
+
}
|
|
16965
17206
|
}
|
|
16966
|
-
|
|
16967
|
-
|
|
16968
|
-
|
|
16969
|
-
|
|
16970
|
-
|
|
16971
|
-
|
|
16972
|
-
|
|
17207
|
+
else if (stroke[2]) {
|
|
17208
|
+
const endP = points[points.length - 1];
|
|
17209
|
+
context.moveTo(endP.x + offsetX, endP.y + offsetY, z);
|
|
17210
|
+
for (let i = points.length - 2; i >= 0; i--) {
|
|
17211
|
+
const p = points[i];
|
|
17212
|
+
context.lineTo(((_a = p.x1) !== null && _a !== void 0 ? _a : p.x) + offsetX, ((_b = p.y1) !== null && _b !== void 0 ? _b : p.y) + offsetY, z);
|
|
17213
|
+
}
|
|
16973
17214
|
}
|
|
16974
17215
|
}
|
|
17216
|
+
if (strokeCb) {
|
|
17217
|
+
strokeCb(context, area.attribute, areaAttribute);
|
|
17218
|
+
}
|
|
17219
|
+
else {
|
|
17220
|
+
context.setStrokeStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute);
|
|
17221
|
+
context.stroke();
|
|
17222
|
+
}
|
|
16975
17223
|
}
|
|
16976
|
-
|
|
16977
|
-
|
|
16978
|
-
|
|
16979
|
-
|
|
16980
|
-
context.setStrokeStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute);
|
|
16981
|
-
context.stroke();
|
|
16982
|
-
}
|
|
16983
|
-
}
|
|
17224
|
+
};
|
|
17225
|
+
_runFill();
|
|
17226
|
+
this.afterRenderStep(area, context, offsetX, offsetY, !!fillOpacity, false, fill, false, areaAttribute, drawContext, fillCb, null, { attribute: area.attribute });
|
|
17227
|
+
_runStroke();
|
|
16984
17228
|
}
|
|
16985
17229
|
drawShape(area, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
16986
17230
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -17210,38 +17454,44 @@ let DefaultCanvasAreaRender = class DefaultCanvasAreaRender extends BaseRender {
|
|
|
17210
17454
|
this.beforeRenderStep(area, context, offsetX, offsetY, !!fillOpacity, false, fill, false, defaultAttribute, drawContext, fillCb, null, { attribute });
|
|
17211
17455
|
context.setShadowBlendStyle && context.setShadowBlendStyle(area, attribute, defaultAttribute);
|
|
17212
17456
|
const { x: originX = 0, x: originY = 0 } = attribute;
|
|
17213
|
-
|
|
17214
|
-
if (
|
|
17215
|
-
fillCb
|
|
17216
|
-
|
|
17217
|
-
|
|
17218
|
-
|
|
17219
|
-
|
|
17220
|
-
|
|
17221
|
-
|
|
17222
|
-
this.afterRenderStep(area, context, offsetX, offsetY, !!fillOpacity, false, fill, false, defaultAttribute, drawContext, fillCb, null, { attribute });
|
|
17223
|
-
if (stroke !== false) {
|
|
17224
|
-
if (strokeCb) {
|
|
17225
|
-
strokeCb(context, attribute, defaultAttribute);
|
|
17457
|
+
const _runFill = () => {
|
|
17458
|
+
if (fill !== false) {
|
|
17459
|
+
if (fillCb) {
|
|
17460
|
+
fillCb(context, attribute, defaultAttribute);
|
|
17461
|
+
}
|
|
17462
|
+
else if (fillOpacity) {
|
|
17463
|
+
context.setCommonStyle(area, connect ? connectedStyle : attribute, originX - offsetX, originY - offsetY, connect ? da : defaultAttribute);
|
|
17464
|
+
context.fill();
|
|
17465
|
+
}
|
|
17226
17466
|
}
|
|
17227
|
-
|
|
17228
|
-
|
|
17229
|
-
|
|
17230
|
-
|
|
17231
|
-
|
|
17232
|
-
|
|
17233
|
-
|
|
17234
|
-
|
|
17235
|
-
|
|
17236
|
-
|
|
17237
|
-
|
|
17238
|
-
|
|
17239
|
-
|
|
17467
|
+
};
|
|
17468
|
+
const _runStroke = () => {
|
|
17469
|
+
if (stroke !== false) {
|
|
17470
|
+
if (strokeCb) {
|
|
17471
|
+
strokeCb(context, attribute, defaultAttribute);
|
|
17472
|
+
}
|
|
17473
|
+
else {
|
|
17474
|
+
const { stroke = defaultAttribute && defaultAttribute[1] && defaultAttribute[1].stroke } = attribute;
|
|
17475
|
+
if (isArray(stroke) && (stroke[0] || stroke[2]) && stroke[1] === false) {
|
|
17476
|
+
context.beginPath();
|
|
17477
|
+
drawSegments(context.camera ? context : context.nativeContext, stroke[0] ? cache.top : cache.bottom, clipRange, direction === Direction$1.ROW ? 'x' : 'y', {
|
|
17478
|
+
offsetX,
|
|
17479
|
+
offsetY,
|
|
17480
|
+
offsetZ,
|
|
17481
|
+
drawConnect: connect,
|
|
17482
|
+
mode: connectedType,
|
|
17483
|
+
zeroX: connectedX,
|
|
17484
|
+
zeroY: connectedY
|
|
17485
|
+
});
|
|
17486
|
+
}
|
|
17487
|
+
context.setStrokeStyle(area, connect ? connectedStyle : attribute, originX - offsetX, originY - offsetY, connect ? da : defaultAttribute);
|
|
17488
|
+
context.stroke();
|
|
17240
17489
|
}
|
|
17241
|
-
context.setStrokeStyle(area, connect ? connectedStyle : attribute, originX - offsetX, originY - offsetY, connect ? da : defaultAttribute);
|
|
17242
|
-
context.stroke();
|
|
17243
17490
|
}
|
|
17244
|
-
}
|
|
17491
|
+
};
|
|
17492
|
+
_runFill();
|
|
17493
|
+
this.afterRenderStep(area, context, offsetX, offsetY, !!fillOpacity, false, fill, false, defaultAttribute, drawContext, fillCb, null, { attribute });
|
|
17494
|
+
_runStroke();
|
|
17245
17495
|
return ret;
|
|
17246
17496
|
}
|
|
17247
17497
|
};
|
|
@@ -17266,7 +17516,7 @@ let DefaultCanvasPathRender = class DefaultCanvasPathRender extends BaseRender {
|
|
|
17266
17516
|
drawShape(path, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
17267
17517
|
var _a, _b, _c;
|
|
17268
17518
|
const pathAttribute = (_a = this.tempTheme) !== null && _a !== void 0 ? _a : getTheme(path, params === null || params === void 0 ? void 0 : params.theme).path;
|
|
17269
|
-
const { x: originX = pathAttribute.x, y: originY = pathAttribute.y } = path.attribute;
|
|
17519
|
+
const { x: originX = pathAttribute.x, y: originY = pathAttribute.y, fillStrokeOrder = pathAttribute.fillStrokeOrder } = path.attribute;
|
|
17270
17520
|
const z = (_b = this.z) !== null && _b !== void 0 ? _b : 0;
|
|
17271
17521
|
const data = this.valid(path, pathAttribute, fillCb, strokeCb);
|
|
17272
17522
|
if (!data) {
|
|
@@ -17283,23 +17533,35 @@ let DefaultCanvasPathRender = class DefaultCanvasPathRender extends BaseRender {
|
|
|
17283
17533
|
}
|
|
17284
17534
|
context.setShadowBlendStyle && context.setShadowBlendStyle(path, path.attribute, pathAttribute);
|
|
17285
17535
|
this.beforeRenderStep(path, context, x, y, doFill, doStroke, fVisible, sVisible, pathAttribute, drawContext, fillCb, strokeCb);
|
|
17286
|
-
|
|
17287
|
-
if (
|
|
17288
|
-
strokeCb
|
|
17536
|
+
const _runStroke = () => {
|
|
17537
|
+
if (doStroke) {
|
|
17538
|
+
if (strokeCb) {
|
|
17539
|
+
strokeCb(context, path.attribute, pathAttribute);
|
|
17540
|
+
}
|
|
17541
|
+
else if (sVisible) {
|
|
17542
|
+
context.setStrokeStyle(path, path.attribute, originX - x, originY - y, pathAttribute);
|
|
17543
|
+
context.stroke();
|
|
17544
|
+
}
|
|
17289
17545
|
}
|
|
17290
|
-
|
|
17291
|
-
|
|
17292
|
-
|
|
17546
|
+
};
|
|
17547
|
+
const _runFill = () => {
|
|
17548
|
+
if (doFill) {
|
|
17549
|
+
if (fillCb) {
|
|
17550
|
+
fillCb(context, path.attribute, pathAttribute);
|
|
17551
|
+
}
|
|
17552
|
+
else if (fVisible) {
|
|
17553
|
+
context.setCommonStyle(path, path.attribute, originX - x, originY - y, pathAttribute);
|
|
17554
|
+
context.fill();
|
|
17555
|
+
}
|
|
17293
17556
|
}
|
|
17557
|
+
};
|
|
17558
|
+
if (!fillStrokeOrder) {
|
|
17559
|
+
_runFill();
|
|
17560
|
+
_runStroke();
|
|
17294
17561
|
}
|
|
17295
|
-
|
|
17296
|
-
|
|
17297
|
-
|
|
17298
|
-
}
|
|
17299
|
-
else if (fVisible) {
|
|
17300
|
-
context.setCommonStyle(path, path.attribute, originX - x, originY - y, pathAttribute);
|
|
17301
|
-
context.fill();
|
|
17302
|
-
}
|
|
17562
|
+
else {
|
|
17563
|
+
_runStroke();
|
|
17564
|
+
_runFill();
|
|
17303
17565
|
}
|
|
17304
17566
|
this.afterRenderStep(path, context, x, y, doFill, doStroke, fVisible, sVisible, pathAttribute, drawContext, fillCb, strokeCb);
|
|
17305
17567
|
}
|
|
@@ -17333,7 +17595,7 @@ let DefaultCanvasRectRender = class DefaultCanvasRectRender extends BaseRender {
|
|
|
17333
17595
|
drawShape(rect, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
17334
17596
|
var _a;
|
|
17335
17597
|
const rectAttribute = (_a = this.tempTheme) !== null && _a !== void 0 ? _a : getTheme(rect, params === null || params === void 0 ? void 0 : params.theme).rect;
|
|
17336
|
-
const { fill = rectAttribute.fill, background, stroke = rectAttribute.stroke, cornerRadius = rectAttribute.cornerRadius, opacity = rectAttribute.opacity, fillOpacity = rectAttribute.fillOpacity, lineWidth = rectAttribute.lineWidth, strokeOpacity = rectAttribute.strokeOpacity, visible = rectAttribute.visible, x1, y1, x: originX = rectAttribute.x, y: originY = rectAttribute.y } = rect.attribute;
|
|
17598
|
+
const { fill = rectAttribute.fill, background, stroke = rectAttribute.stroke, cornerRadius = rectAttribute.cornerRadius, opacity = rectAttribute.opacity, fillOpacity = rectAttribute.fillOpacity, lineWidth = rectAttribute.lineWidth, strokeOpacity = rectAttribute.strokeOpacity, visible = rectAttribute.visible, x1, y1, x: originX = rectAttribute.x, y: originY = rectAttribute.y, fillStrokeOrder = rectAttribute.fillStrokeOrder } = rect.attribute;
|
|
17337
17599
|
let { width, height } = rect.attribute;
|
|
17338
17600
|
width = (width !== null && width !== void 0 ? width : x1 - originX) || 0;
|
|
17339
17601
|
height = (height !== null && height !== void 0 ? height : y1 - originY) || 0;
|
|
@@ -17364,23 +17626,35 @@ let DefaultCanvasRectRender = class DefaultCanvasRectRender extends BaseRender {
|
|
|
17364
17626
|
};
|
|
17365
17627
|
context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute);
|
|
17366
17628
|
this.beforeRenderStep(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb, doFillOrStroke);
|
|
17367
|
-
|
|
17368
|
-
if (
|
|
17369
|
-
fillCb
|
|
17629
|
+
const _runFill = () => {
|
|
17630
|
+
if (doFillOrStroke.doFill) {
|
|
17631
|
+
if (fillCb) {
|
|
17632
|
+
fillCb(context, rect.attribute, rectAttribute);
|
|
17633
|
+
}
|
|
17634
|
+
else if (fVisible) {
|
|
17635
|
+
context.setCommonStyle(rect, rect.attribute, originX - x, originY - y, rectAttribute);
|
|
17636
|
+
context.fill();
|
|
17637
|
+
}
|
|
17370
17638
|
}
|
|
17371
|
-
|
|
17372
|
-
|
|
17373
|
-
|
|
17639
|
+
};
|
|
17640
|
+
const _runStroke = () => {
|
|
17641
|
+
if (doFillOrStroke.doStroke) {
|
|
17642
|
+
if (strokeCb) {
|
|
17643
|
+
strokeCb(context, rect.attribute, rectAttribute);
|
|
17644
|
+
}
|
|
17645
|
+
else if (sVisible) {
|
|
17646
|
+
context.setStrokeStyle(rect, rect.attribute, originX - x, originY - y, rectAttribute);
|
|
17647
|
+
context.stroke();
|
|
17648
|
+
}
|
|
17374
17649
|
}
|
|
17650
|
+
};
|
|
17651
|
+
if (!fillStrokeOrder) {
|
|
17652
|
+
_runFill();
|
|
17653
|
+
_runStroke();
|
|
17375
17654
|
}
|
|
17376
|
-
|
|
17377
|
-
|
|
17378
|
-
|
|
17379
|
-
}
|
|
17380
|
-
else if (sVisible) {
|
|
17381
|
-
context.setStrokeStyle(rect, rect.attribute, originX - x, originY - y, rectAttribute);
|
|
17382
|
-
context.stroke();
|
|
17383
|
-
}
|
|
17655
|
+
else {
|
|
17656
|
+
_runStroke();
|
|
17657
|
+
_runFill();
|
|
17384
17658
|
}
|
|
17385
17659
|
this.afterRenderStep(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb);
|
|
17386
17660
|
}
|
|
@@ -17413,7 +17687,7 @@ let DefaultCanvasSymbolRender = class DefaultCanvasSymbolRender extends BaseRend
|
|
|
17413
17687
|
drawShape(symbol, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
17414
17688
|
var _a;
|
|
17415
17689
|
const symbolAttribute = getTheme(symbol, params === null || params === void 0 ? void 0 : params.theme).symbol;
|
|
17416
|
-
const { size = symbolAttribute.size, x: originX = symbolAttribute.x, y: originY = symbolAttribute.y, scaleX = symbolAttribute.scaleX, scaleY = symbolAttribute.scaleY } = symbol.attribute;
|
|
17690
|
+
const { size = symbolAttribute.size, x: originX = symbolAttribute.x, y: originY = symbolAttribute.y, scaleX = symbolAttribute.scaleX, scaleY = symbolAttribute.scaleY, fillStrokeOrder = symbolAttribute.fillStrokeOrder } = symbol.attribute;
|
|
17417
17691
|
const data = this.valid(symbol, symbolAttribute, fillCb, strokeCb);
|
|
17418
17692
|
if (!data) {
|
|
17419
17693
|
return;
|
|
@@ -17436,23 +17710,35 @@ let DefaultCanvasSymbolRender = class DefaultCanvasSymbolRender extends BaseRend
|
|
|
17436
17710
|
obj.stroke = (_c = a.stroke) !== null && _c !== void 0 ? _c : symbol.attribute.stroke;
|
|
17437
17711
|
a = obj;
|
|
17438
17712
|
}
|
|
17439
|
-
|
|
17440
|
-
if (
|
|
17441
|
-
fillCb
|
|
17713
|
+
const _runFill = () => {
|
|
17714
|
+
if (a.fill) {
|
|
17715
|
+
if (fillCb) {
|
|
17716
|
+
fillCb(context, symbol.attribute, symbolAttribute);
|
|
17717
|
+
}
|
|
17718
|
+
else {
|
|
17719
|
+
context.setCommonStyle(symbol, a, originX - x, originY - y, symbolAttribute);
|
|
17720
|
+
context.fill();
|
|
17721
|
+
}
|
|
17442
17722
|
}
|
|
17443
|
-
|
|
17444
|
-
|
|
17445
|
-
|
|
17723
|
+
};
|
|
17724
|
+
const _runStroke = () => {
|
|
17725
|
+
if (a.stroke) {
|
|
17726
|
+
if (strokeCb) {
|
|
17727
|
+
strokeCb(context, symbol.attribute, symbolAttribute);
|
|
17728
|
+
}
|
|
17729
|
+
else {
|
|
17730
|
+
context.setStrokeStyle(symbol, a, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute);
|
|
17731
|
+
context.stroke();
|
|
17732
|
+
}
|
|
17446
17733
|
}
|
|
17734
|
+
};
|
|
17735
|
+
if (!fillStrokeOrder) {
|
|
17736
|
+
_runFill();
|
|
17737
|
+
_runStroke();
|
|
17447
17738
|
}
|
|
17448
|
-
|
|
17449
|
-
|
|
17450
|
-
|
|
17451
|
-
}
|
|
17452
|
-
else {
|
|
17453
|
-
context.setStrokeStyle(symbol, a, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute);
|
|
17454
|
-
context.stroke();
|
|
17455
|
-
}
|
|
17739
|
+
else {
|
|
17740
|
+
_runStroke();
|
|
17741
|
+
_runFill();
|
|
17456
17742
|
}
|
|
17457
17743
|
};
|
|
17458
17744
|
if (keepDirIn3d && context.camera && context.project) {
|
|
@@ -17471,23 +17757,35 @@ let DefaultCanvasSymbolRender = class DefaultCanvasSymbolRender extends BaseRend
|
|
|
17471
17757
|
}
|
|
17472
17758
|
context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute);
|
|
17473
17759
|
this.beforeRenderStep(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb);
|
|
17474
|
-
|
|
17475
|
-
if (
|
|
17476
|
-
fillCb
|
|
17760
|
+
const _runFill = () => {
|
|
17761
|
+
if (doFill && !parsedPath.isSvg) {
|
|
17762
|
+
if (fillCb) {
|
|
17763
|
+
fillCb(context, symbol.attribute, symbolAttribute);
|
|
17764
|
+
}
|
|
17765
|
+
else if (fVisible) {
|
|
17766
|
+
context.setCommonStyle(symbol, symbol.attribute, originX - x, originY - y, symbolAttribute);
|
|
17767
|
+
context.fill();
|
|
17768
|
+
}
|
|
17477
17769
|
}
|
|
17478
|
-
|
|
17479
|
-
|
|
17480
|
-
|
|
17770
|
+
};
|
|
17771
|
+
const _runStroke = () => {
|
|
17772
|
+
if (doStroke && !parsedPath.isSvg) {
|
|
17773
|
+
if (strokeCb) {
|
|
17774
|
+
strokeCb(context, symbol.attribute, symbolAttribute);
|
|
17775
|
+
}
|
|
17776
|
+
else if (sVisible) {
|
|
17777
|
+
context.setStrokeStyle(symbol, symbol.attribute, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute);
|
|
17778
|
+
context.stroke();
|
|
17779
|
+
}
|
|
17481
17780
|
}
|
|
17781
|
+
};
|
|
17782
|
+
if (!fillStrokeOrder) {
|
|
17783
|
+
_runFill();
|
|
17784
|
+
_runStroke();
|
|
17482
17785
|
}
|
|
17483
|
-
|
|
17484
|
-
|
|
17485
|
-
|
|
17486
|
-
}
|
|
17487
|
-
else if (sVisible) {
|
|
17488
|
-
context.setStrokeStyle(symbol, symbol.attribute, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute);
|
|
17489
|
-
context.stroke();
|
|
17490
|
-
}
|
|
17786
|
+
else {
|
|
17787
|
+
_runStroke();
|
|
17788
|
+
_runFill();
|
|
17491
17789
|
}
|
|
17492
17790
|
this.afterRenderStep(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb);
|
|
17493
17791
|
}
|
|
@@ -17681,13 +17979,7 @@ let DefaultCanvasTextRender = class DefaultCanvasTextRender extends BaseRender {
|
|
|
17681
17979
|
var _a, _b, _c;
|
|
17682
17980
|
const textAttribute = getTheme(text, params === null || params === void 0 ? void 0 : params.theme).text;
|
|
17683
17981
|
const { text: str, underline = textAttribute.underline, lineThrough = textAttribute.lineThrough, keepDirIn3d = textAttribute.keepDirIn3d, direction = textAttribute.direction, fontSize = textAttribute.fontSize, verticalMode = textAttribute.verticalMode, x: originX = textAttribute.x, y: originY = textAttribute.y } = text.attribute;
|
|
17684
|
-
|
|
17685
|
-
if (!verticalMode && direction === 'vertical') {
|
|
17686
|
-
const t = textAlign;
|
|
17687
|
-
textAlign = (_a = text.getBaselineMapAlign()[textBaseline]) !== null && _a !== void 0 ? _a : 'left';
|
|
17688
|
-
textBaseline = (_b = text.getAlignMapBaseline()[t]) !== null && _b !== void 0 ? _b : 'top';
|
|
17689
|
-
}
|
|
17690
|
-
const lineHeight = (_c = calculateLineHeight(text.attribute.lineHeight, fontSize)) !== null && _c !== void 0 ? _c : fontSize;
|
|
17982
|
+
const lineHeight = (_a = calculateLineHeight(text.attribute.lineHeight, fontSize)) !== null && _a !== void 0 ? _a : fontSize;
|
|
17691
17983
|
const data = this.valid(text, textAttribute, fillCb, strokeCb);
|
|
17692
17984
|
if (!data) {
|
|
17693
17985
|
return;
|
|
@@ -17726,7 +18018,6 @@ let DefaultCanvasTextRender = class DefaultCanvasTextRender extends BaseRender {
|
|
|
17726
18018
|
else if (fVisible) {
|
|
17727
18019
|
context.setCommonStyle(text, text.attribute, originX - x, originY - y, textAttribute);
|
|
17728
18020
|
context.fillText(t, _x, _y, z);
|
|
17729
|
-
this.drawUnderLine(underline, lineThrough, text, _x, _y, z, textAttribute, context);
|
|
17730
18021
|
}
|
|
17731
18022
|
}
|
|
17732
18023
|
if (direction) {
|
|
@@ -17734,132 +18025,88 @@ let DefaultCanvasTextRender = class DefaultCanvasTextRender extends BaseRender {
|
|
|
17734
18025
|
context.setTransformForCurrent();
|
|
17735
18026
|
}
|
|
17736
18027
|
};
|
|
17737
|
-
|
|
17738
|
-
|
|
17739
|
-
|
|
17740
|
-
|
|
17741
|
-
|
|
17742
|
-
|
|
17743
|
-
return;
|
|
17744
|
-
}
|
|
17745
|
-
const { xOffset, yOffset } = multilineLayout.bbox;
|
|
17746
|
-
if (doStroke) {
|
|
17747
|
-
if (strokeCb) {
|
|
17748
|
-
strokeCb(context, text.attribute, textAttribute);
|
|
17749
|
-
}
|
|
17750
|
-
else if (sVisible) {
|
|
17751
|
-
context.setStrokeStyle(text, text.attribute, originX - x, originY - y, textAttribute);
|
|
17752
|
-
multilineLayout.lines.forEach(line => {
|
|
17753
|
-
context.strokeText(line.str, (line.leftOffset || 0) + xOffset + x, (line.topOffset || 0) + yOffset + y, z);
|
|
17754
|
-
});
|
|
17755
|
-
}
|
|
17756
|
-
}
|
|
17757
|
-
if (doFill) {
|
|
17758
|
-
if (fillCb) {
|
|
17759
|
-
fillCb(context, text.attribute, textAttribute);
|
|
17760
|
-
}
|
|
17761
|
-
else if (fVisible) {
|
|
17762
|
-
context.setCommonStyle(text, text.attribute, originX - x, originY - y, textAttribute);
|
|
17763
|
-
multilineLayout.lines.forEach(line => {
|
|
17764
|
-
context.fillText(line.str, (line.leftOffset || 0) + xOffset + x, (line.topOffset || 0) + yOffset + y, z);
|
|
17765
|
-
this.drawUnderLine(underline, lineThrough, text, (line.leftOffset || 0) + xOffset + x, (line.topOffset || 0) + yOffset + y - textDrawOffsetY('bottom', fontSize) - 0.05 * fontSize, z, textAttribute, context, {
|
|
17766
|
-
width: line.width
|
|
17767
|
-
});
|
|
17768
|
-
});
|
|
17769
|
-
}
|
|
17770
|
-
}
|
|
18028
|
+
context.setTextStyleWithoutAlignBaseline(text.attribute, textAttribute, z);
|
|
18029
|
+
if (direction === 'horizontal') {
|
|
18030
|
+
const { multilineLayout } = text;
|
|
18031
|
+
if (!multilineLayout) {
|
|
18032
|
+
context.highPerformanceRestore();
|
|
18033
|
+
return;
|
|
17771
18034
|
}
|
|
17772
|
-
|
|
17773
|
-
|
|
17774
|
-
|
|
17775
|
-
|
|
17776
|
-
context.textAlign = 'left';
|
|
17777
|
-
context.textBaseline = 'top';
|
|
17778
|
-
const totalHeight = lineHeight * verticalList.length;
|
|
17779
|
-
let totalW = 0;
|
|
17780
|
-
verticalList.forEach(verticalData => {
|
|
17781
|
-
const _w = verticalData.reduce((a, b) => a + (b.width || 0), 0);
|
|
17782
|
-
totalW = max(_w, totalW);
|
|
17783
|
-
});
|
|
17784
|
-
let offsetY = 0;
|
|
17785
|
-
let offsetX = 0;
|
|
17786
|
-
if (textBaseline === 'bottom') {
|
|
17787
|
-
offsetX = -totalHeight;
|
|
18035
|
+
const { xOffset, yOffset } = multilineLayout.bbox;
|
|
18036
|
+
if (doStroke) {
|
|
18037
|
+
if (strokeCb) {
|
|
18038
|
+
strokeCb(context, text.attribute, textAttribute);
|
|
17788
18039
|
}
|
|
17789
|
-
else if (
|
|
17790
|
-
|
|
18040
|
+
else if (sVisible) {
|
|
18041
|
+
context.setStrokeStyle(text, text.attribute, originX - x, originY - y, textAttribute);
|
|
18042
|
+
multilineLayout.lines.forEach(line => {
|
|
18043
|
+
context.strokeText(line.str, (line.leftOffset || 0) + xOffset + x, (line.topOffset || 0) + yOffset + y, z);
|
|
18044
|
+
});
|
|
17791
18045
|
}
|
|
17792
|
-
|
|
17793
|
-
|
|
18046
|
+
}
|
|
18047
|
+
if (doFill) {
|
|
18048
|
+
if (fillCb) {
|
|
18049
|
+
fillCb(context, text.attribute, textAttribute);
|
|
17794
18050
|
}
|
|
17795
|
-
else if (
|
|
17796
|
-
|
|
17797
|
-
|
|
17798
|
-
|
|
17799
|
-
|
|
17800
|
-
|
|
17801
|
-
|
|
17802
|
-
if (textAlign === 'center') {
|
|
17803
|
-
currentOffsetY += dw / 2;
|
|
17804
|
-
}
|
|
17805
|
-
else if (textAlign === 'right') {
|
|
17806
|
-
currentOffsetY += dw;
|
|
17807
|
-
}
|
|
17808
|
-
verticalData.forEach(item => {
|
|
17809
|
-
const { text, width, direction } = item;
|
|
17810
|
-
drawText(text, totalHeight - (i + 1) * lineHeight + offsetX, currentOffsetY, direction);
|
|
17811
|
-
currentOffsetY += width;
|
|
18051
|
+
else if (fVisible) {
|
|
18052
|
+
context.setCommonStyle(text, text.attribute, originX - x, originY - y, textAttribute);
|
|
18053
|
+
multilineLayout.lines.forEach(line => {
|
|
18054
|
+
context.fillText(line.str, (line.leftOffset || 0) + xOffset + x, (line.topOffset || 0) + yOffset + y, z);
|
|
18055
|
+
this.drawUnderLine(underline, lineThrough, text, (line.leftOffset || 0) + xOffset + x, (line.topOffset || 0) + yOffset + y, line.descent, (line.descent - line.ascent) / 2, z, textAttribute, context, {
|
|
18056
|
+
width: line.width
|
|
18057
|
+
});
|
|
17812
18058
|
});
|
|
17813
|
-
}
|
|
18059
|
+
}
|
|
17814
18060
|
}
|
|
17815
18061
|
}
|
|
17816
18062
|
else {
|
|
17817
|
-
|
|
17818
|
-
|
|
17819
|
-
const t =
|
|
17820
|
-
|
|
17821
|
-
|
|
17822
|
-
|
|
17823
|
-
|
|
17824
|
-
|
|
17825
|
-
|
|
17826
|
-
|
|
17827
|
-
|
|
17828
|
-
|
|
17829
|
-
|
|
17830
|
-
|
|
17831
|
-
|
|
18063
|
+
let { textAlign = textAttribute.textAlign, textBaseline = textAttribute.textBaseline } = text.attribute;
|
|
18064
|
+
if (!verticalMode) {
|
|
18065
|
+
const t = textAlign;
|
|
18066
|
+
textAlign = (_b = text.getBaselineMapAlign()[textBaseline]) !== null && _b !== void 0 ? _b : 'left';
|
|
18067
|
+
textBaseline = (_c = text.getAlignMapBaseline()[t]) !== null && _c !== void 0 ? _c : 'top';
|
|
18068
|
+
}
|
|
18069
|
+
text.tryUpdateAABBBounds();
|
|
18070
|
+
const cache = text.cache;
|
|
18071
|
+
const { verticalList } = cache;
|
|
18072
|
+
context.textAlign = 'left';
|
|
18073
|
+
context.textBaseline = 'top';
|
|
18074
|
+
const totalHeight = lineHeight * verticalList.length;
|
|
18075
|
+
let totalW = 0;
|
|
18076
|
+
verticalList.forEach(verticalData => {
|
|
18077
|
+
const _w = verticalData.reduce((a, b) => a + (b.width || 0), 0);
|
|
18078
|
+
totalW = max(_w, totalW);
|
|
18079
|
+
});
|
|
18080
|
+
let offsetY = 0;
|
|
18081
|
+
let offsetX = 0;
|
|
18082
|
+
if (textBaseline === 'bottom') {
|
|
18083
|
+
offsetX = -totalHeight;
|
|
17832
18084
|
}
|
|
17833
|
-
else {
|
|
17834
|
-
|
|
17835
|
-
const cache = text.cache;
|
|
17836
|
-
if (cache) {
|
|
17837
|
-
context.setTextStyleWithoutAlignBaseline(text.attribute, textAttribute, z);
|
|
17838
|
-
const { verticalList } = cache;
|
|
17839
|
-
let offsetY = 0;
|
|
17840
|
-
const totalW = verticalList[0].reduce((a, b) => a + (b.width || 0), 0);
|
|
17841
|
-
let offsetX = 0;
|
|
17842
|
-
if (textBaseline === 'bottom') {
|
|
17843
|
-
offsetX = -lineHeight;
|
|
17844
|
-
}
|
|
17845
|
-
else if (textBaseline === 'middle') {
|
|
17846
|
-
offsetX = -lineHeight / 2;
|
|
17847
|
-
}
|
|
17848
|
-
if (textAlign === 'center') {
|
|
17849
|
-
offsetY -= totalW / 2;
|
|
17850
|
-
}
|
|
17851
|
-
else if (textAlign === 'right') {
|
|
17852
|
-
offsetY -= totalW;
|
|
17853
|
-
}
|
|
17854
|
-
context.textAlign = 'left';
|
|
17855
|
-
context.textBaseline = 'top';
|
|
17856
|
-
verticalList[0].forEach(item => {
|
|
17857
|
-
const { text, width, direction } = item;
|
|
17858
|
-
drawText(text, offsetX, offsetY, direction);
|
|
17859
|
-
offsetY += width;
|
|
17860
|
-
});
|
|
17861
|
-
}
|
|
18085
|
+
else if (textBaseline === 'middle') {
|
|
18086
|
+
offsetX = -totalHeight / 2;
|
|
17862
18087
|
}
|
|
18088
|
+
if (textAlign === 'center') {
|
|
18089
|
+
offsetY -= totalW / 2;
|
|
18090
|
+
}
|
|
18091
|
+
else if (textAlign === 'right') {
|
|
18092
|
+
offsetY -= totalW;
|
|
18093
|
+
}
|
|
18094
|
+
verticalList.forEach((verticalData, i) => {
|
|
18095
|
+
const currentW = verticalData.reduce((a, b) => a + (b.width || 0), 0);
|
|
18096
|
+
const dw = totalW - currentW;
|
|
18097
|
+
let currentOffsetY = offsetY;
|
|
18098
|
+
if (textAlign === 'center') {
|
|
18099
|
+
currentOffsetY += dw / 2;
|
|
18100
|
+
}
|
|
18101
|
+
else if (textAlign === 'right') {
|
|
18102
|
+
currentOffsetY += dw;
|
|
18103
|
+
}
|
|
18104
|
+
verticalData.forEach(item => {
|
|
18105
|
+
const { text, width, direction } = item;
|
|
18106
|
+
drawText(text, totalHeight - (i + 1) * lineHeight + offsetX, currentOffsetY, direction);
|
|
18107
|
+
currentOffsetY += width;
|
|
18108
|
+
});
|
|
18109
|
+
});
|
|
17863
18110
|
}
|
|
17864
18111
|
transform3dMatrixToContextMatrix && this.restoreTransformUseContext2d(text, textAttribute, z, context);
|
|
17865
18112
|
this.afterRenderStep(text, context, x, y, doFill, doStroke, fVisible, sVisible, textAttribute, drawContext, fillCb, strokeCb);
|
|
@@ -17870,37 +18117,32 @@ let DefaultCanvasTextRender = class DefaultCanvasTextRender extends BaseRender {
|
|
|
17870
18117
|
const computed3dMatrix = !keepDirIn3d;
|
|
17871
18118
|
this._draw(text, textAttribute, computed3dMatrix, drawContext, params);
|
|
17872
18119
|
}
|
|
17873
|
-
drawUnderLine(underline, lineThrough, text,
|
|
18120
|
+
drawUnderLine(underline, lineThrough, text, anchorX, anchorY, offsetUnderLineY, offsetThroughLineY, z, textAttribute, context, multiOption) {
|
|
17874
18121
|
if (lineThrough + underline <= 0) {
|
|
17875
18122
|
return;
|
|
17876
18123
|
}
|
|
17877
|
-
const { textAlign = textAttribute.textAlign,
|
|
18124
|
+
const { textAlign = textAttribute.textAlign, fill = textAttribute.fill, opacity = textAttribute.opacity, underlineOffset = textAttribute.underlineOffset, underlineDash = textAttribute.underlineDash, fillOpacity = textAttribute.fillOpacity } = text.attribute;
|
|
17878
18125
|
const isMulti = !isNil(multiOption);
|
|
17879
18126
|
const w = isMulti ? multiOption.width : text.clipedWidth;
|
|
17880
18127
|
const offsetX = isMulti ? 0 : textDrawOffsetX(textAlign, w);
|
|
17881
|
-
const offsetY = textLayoutOffsetY(isMulti ? 'alphabetic' : textBaseline, fontSize, fontSize);
|
|
17882
18128
|
const attribute = { lineWidth: 0, stroke: fill, opacity, strokeOpacity: fillOpacity };
|
|
17883
|
-
let deltaY = isMulti ? -3 : 0;
|
|
17884
18129
|
if (underline) {
|
|
17885
18130
|
attribute.lineWidth = underline;
|
|
17886
|
-
context.setStrokeStyle(text, attribute,
|
|
18131
|
+
context.setStrokeStyle(text, attribute, anchorX, anchorY, textAttribute);
|
|
17887
18132
|
underlineDash && context.setLineDash(underlineDash);
|
|
17888
18133
|
context.beginPath();
|
|
17889
|
-
const dy =
|
|
17890
|
-
context.moveTo(
|
|
17891
|
-
context.lineTo(
|
|
18134
|
+
const dy = anchorY + offsetUnderLineY + underlineOffset;
|
|
18135
|
+
context.moveTo(anchorX + offsetX, dy, z);
|
|
18136
|
+
context.lineTo(anchorX + offsetX + w, dy, z);
|
|
17892
18137
|
context.stroke();
|
|
17893
18138
|
}
|
|
17894
|
-
if (isMulti) {
|
|
17895
|
-
deltaY = -1;
|
|
17896
|
-
}
|
|
17897
18139
|
if (lineThrough) {
|
|
17898
18140
|
attribute.lineWidth = lineThrough;
|
|
17899
|
-
context.setStrokeStyle(text, attribute,
|
|
18141
|
+
context.setStrokeStyle(text, attribute, anchorX, anchorY, textAttribute);
|
|
17900
18142
|
context.beginPath();
|
|
17901
|
-
const dy =
|
|
17902
|
-
context.moveTo(
|
|
17903
|
-
context.lineTo(
|
|
18143
|
+
const dy = anchorY + offsetThroughLineY;
|
|
18144
|
+
context.moveTo(anchorX + offsetX, dy, z);
|
|
18145
|
+
context.lineTo(anchorX + offsetX + w, dy, z);
|
|
17904
18146
|
context.stroke();
|
|
17905
18147
|
}
|
|
17906
18148
|
}
|
|
@@ -18012,7 +18254,7 @@ let DefaultCanvasPolygonRender = class DefaultCanvasPolygonRender extends BaseRe
|
|
|
18012
18254
|
}
|
|
18013
18255
|
drawShape(polygon, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
18014
18256
|
const polygonAttribute = getTheme(polygon, params === null || params === void 0 ? void 0 : params.theme).polygon;
|
|
18015
|
-
const { points = polygonAttribute.points, cornerRadius = polygonAttribute.cornerRadius, x: originX = polygonAttribute.x, y: originY = polygonAttribute.y, closePath = polygonAttribute.closePath } = polygon.attribute;
|
|
18257
|
+
const { points = polygonAttribute.points, cornerRadius = polygonAttribute.cornerRadius, x: originX = polygonAttribute.x, y: originY = polygonAttribute.y, closePath = polygonAttribute.closePath, fillStrokeOrder = polygonAttribute.fillStrokeOrder } = polygon.attribute;
|
|
18016
18258
|
const data = this.valid(polygon, polygonAttribute, fillCb, strokeCb);
|
|
18017
18259
|
if (!data) {
|
|
18018
18260
|
return;
|
|
@@ -18028,23 +18270,35 @@ let DefaultCanvasPolygonRender = class DefaultCanvasPolygonRender extends BaseRe
|
|
|
18028
18270
|
closePath && context.closePath();
|
|
18029
18271
|
context.setShadowBlendStyle && context.setShadowBlendStyle(polygon, polygon.attribute, polygonAttribute);
|
|
18030
18272
|
this.beforeRenderStep(polygon, context, x, y, doFill, doStroke, fVisible, sVisible, polygonAttribute, drawContext, fillCb, strokeCb);
|
|
18031
|
-
|
|
18032
|
-
if (
|
|
18033
|
-
fillCb
|
|
18273
|
+
const _runFill = () => {
|
|
18274
|
+
if (doFill) {
|
|
18275
|
+
if (fillCb) {
|
|
18276
|
+
fillCb(context, polygon.attribute, polygonAttribute);
|
|
18277
|
+
}
|
|
18278
|
+
else if (fVisible) {
|
|
18279
|
+
context.setCommonStyle(polygon, polygon.attribute, originX - x, originY - y, polygonAttribute);
|
|
18280
|
+
context.fill();
|
|
18281
|
+
}
|
|
18034
18282
|
}
|
|
18035
|
-
|
|
18036
|
-
|
|
18037
|
-
|
|
18283
|
+
};
|
|
18284
|
+
const _runStroke = () => {
|
|
18285
|
+
if (doStroke) {
|
|
18286
|
+
if (strokeCb) {
|
|
18287
|
+
strokeCb(context, polygon.attribute, polygonAttribute);
|
|
18288
|
+
}
|
|
18289
|
+
else if (sVisible) {
|
|
18290
|
+
context.setStrokeStyle(polygon, polygon.attribute, originX - x, originY - y, polygonAttribute);
|
|
18291
|
+
context.stroke();
|
|
18292
|
+
}
|
|
18038
18293
|
}
|
|
18294
|
+
};
|
|
18295
|
+
if (!fillStrokeOrder) {
|
|
18296
|
+
_runFill();
|
|
18297
|
+
_runStroke();
|
|
18039
18298
|
}
|
|
18040
|
-
|
|
18041
|
-
|
|
18042
|
-
|
|
18043
|
-
}
|
|
18044
|
-
else if (sVisible) {
|
|
18045
|
-
context.setStrokeStyle(polygon, polygon.attribute, originX - x, originY - y, polygonAttribute);
|
|
18046
|
-
context.stroke();
|
|
18047
|
-
}
|
|
18299
|
+
else {
|
|
18300
|
+
_runStroke();
|
|
18301
|
+
_runFill();
|
|
18048
18302
|
}
|
|
18049
18303
|
this.afterRenderStep(polygon, context, x, y, doFill, doStroke, fVisible, sVisible, polygonAttribute, drawContext, fillCb, strokeCb);
|
|
18050
18304
|
}
|
|
@@ -18067,7 +18321,7 @@ let DefaultCanvasGroupRender = class DefaultCanvasGroupRender {
|
|
|
18067
18321
|
}
|
|
18068
18322
|
drawShape(group, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
18069
18323
|
const groupAttribute = getTheme(group, params === null || params === void 0 ? void 0 : params.theme).group;
|
|
18070
|
-
const { fill = groupAttribute.fill, background, stroke = groupAttribute.stroke, opacity = groupAttribute.opacity, width = groupAttribute.width, height = groupAttribute.height, clip = groupAttribute.clip, fillOpacity = groupAttribute.fillOpacity, strokeOpacity = groupAttribute.strokeOpacity, cornerRadius = groupAttribute.cornerRadius, path = groupAttribute.path, lineWidth = groupAttribute.lineWidth, visible = groupAttribute.visible } = group.attribute;
|
|
18324
|
+
const { fill = groupAttribute.fill, background, stroke = groupAttribute.stroke, opacity = groupAttribute.opacity, width = groupAttribute.width, height = groupAttribute.height, clip = groupAttribute.clip, fillOpacity = groupAttribute.fillOpacity, strokeOpacity = groupAttribute.strokeOpacity, cornerRadius = groupAttribute.cornerRadius, path = groupAttribute.path, lineWidth = groupAttribute.lineWidth, visible = groupAttribute.visible, fillStrokeOrder = groupAttribute.fillStrokeOrder, x: originX = groupAttribute.x, y: originY = groupAttribute.y } = group.attribute;
|
|
18071
18325
|
const fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill);
|
|
18072
18326
|
const sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height);
|
|
18073
18327
|
const doFill = runFill(fill, background);
|
|
@@ -18123,23 +18377,35 @@ let DefaultCanvasGroupRender = class DefaultCanvasGroupRender {
|
|
|
18123
18377
|
context.clip();
|
|
18124
18378
|
}
|
|
18125
18379
|
context.setShadowBlendStyle && context.setShadowBlendStyle(group, group.attribute, groupAttribute);
|
|
18126
|
-
|
|
18127
|
-
if (
|
|
18128
|
-
fillCb
|
|
18380
|
+
const _runFill = () => {
|
|
18381
|
+
if (doFillOrStroke.doFill) {
|
|
18382
|
+
if (fillCb) {
|
|
18383
|
+
fillCb(context, group.attribute, groupAttribute);
|
|
18384
|
+
}
|
|
18385
|
+
else if (fVisible) {
|
|
18386
|
+
context.setCommonStyle(group, group.attribute, originX - x, originY - y, groupAttribute);
|
|
18387
|
+
context.fill();
|
|
18388
|
+
}
|
|
18129
18389
|
}
|
|
18130
|
-
|
|
18131
|
-
|
|
18132
|
-
|
|
18390
|
+
};
|
|
18391
|
+
const _runStroke = () => {
|
|
18392
|
+
if (doFillOrStroke.doStroke) {
|
|
18393
|
+
if (strokeCb) {
|
|
18394
|
+
strokeCb(context, group.attribute, groupAttribute);
|
|
18395
|
+
}
|
|
18396
|
+
else if (sVisible) {
|
|
18397
|
+
context.setStrokeStyle(group, group.attribute, originX - x, originY - y, groupAttribute);
|
|
18398
|
+
context.stroke();
|
|
18399
|
+
}
|
|
18133
18400
|
}
|
|
18401
|
+
};
|
|
18402
|
+
if (!fillStrokeOrder) {
|
|
18403
|
+
_runFill();
|
|
18404
|
+
_runStroke();
|
|
18134
18405
|
}
|
|
18135
|
-
|
|
18136
|
-
|
|
18137
|
-
|
|
18138
|
-
}
|
|
18139
|
-
else if (sVisible) {
|
|
18140
|
-
context.setStrokeStyle(group, group.attribute, x, y, groupAttribute);
|
|
18141
|
-
context.stroke();
|
|
18142
|
-
}
|
|
18406
|
+
else {
|
|
18407
|
+
_runStroke();
|
|
18408
|
+
_runFill();
|
|
18143
18409
|
}
|
|
18144
18410
|
this._groupRenderContribitions.forEach(c => {
|
|
18145
18411
|
if (c.time === BaseRenderContributionTime.afterFillStroke) {
|
|
@@ -18239,7 +18505,7 @@ let DefaultCanvasImageRender = class DefaultCanvasImageRender extends BaseRender
|
|
|
18239
18505
|
}
|
|
18240
18506
|
drawShape(image, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
18241
18507
|
const imageAttribute = getTheme(image).image;
|
|
18242
|
-
const { width = imageAttribute.width, height = imageAttribute.height, repeatX = imageAttribute.repeatX, repeatY = imageAttribute.repeatY, x: originX = imageAttribute.x, y: originY = imageAttribute.y, cornerRadius = imageAttribute.cornerRadius, image: url } = image.attribute;
|
|
18508
|
+
const { width = imageAttribute.width, height = imageAttribute.height, repeatX = imageAttribute.repeatX, repeatY = imageAttribute.repeatY, x: originX = imageAttribute.x, y: originY = imageAttribute.y, cornerRadius = imageAttribute.cornerRadius, fillStrokeOrder = imageAttribute.fillStrokeOrder, image: url } = image.attribute;
|
|
18243
18509
|
const data = this.valid(image, imageAttribute, fillCb);
|
|
18244
18510
|
if (!data) {
|
|
18245
18511
|
return;
|
|
@@ -18247,58 +18513,70 @@ let DefaultCanvasImageRender = class DefaultCanvasImageRender extends BaseRender
|
|
|
18247
18513
|
const { fVisible, sVisible, doFill, doStroke } = data;
|
|
18248
18514
|
context.setShadowBlendStyle && context.setShadowBlendStyle(image, imageAttribute);
|
|
18249
18515
|
this.beforeRenderStep(image, context, x, y, doFill, false, fVisible, false, imageAttribute, drawContext, fillCb);
|
|
18250
|
-
|
|
18251
|
-
if (
|
|
18252
|
-
fillCb
|
|
18253
|
-
|
|
18254
|
-
else if (fVisible) {
|
|
18255
|
-
if (!url || !image.resources) {
|
|
18256
|
-
return;
|
|
18257
|
-
}
|
|
18258
|
-
const res = image.resources.get(url);
|
|
18259
|
-
if (res.state !== 'success') {
|
|
18260
|
-
return;
|
|
18516
|
+
const _runFill = () => {
|
|
18517
|
+
if (doFill) {
|
|
18518
|
+
if (fillCb) {
|
|
18519
|
+
fillCb(context, image.attribute, imageAttribute);
|
|
18261
18520
|
}
|
|
18262
|
-
|
|
18263
|
-
|
|
18264
|
-
|
|
18265
|
-
|
|
18266
|
-
|
|
18267
|
-
|
|
18268
|
-
|
|
18269
|
-
|
|
18270
|
-
|
|
18271
|
-
|
|
18272
|
-
|
|
18273
|
-
|
|
18274
|
-
|
|
18275
|
-
|
|
18276
|
-
|
|
18277
|
-
|
|
18278
|
-
|
|
18279
|
-
|
|
18280
|
-
|
|
18281
|
-
|
|
18282
|
-
|
|
18283
|
-
|
|
18284
|
-
|
|
18521
|
+
else if (fVisible) {
|
|
18522
|
+
if (!url || !image.resources) {
|
|
18523
|
+
return;
|
|
18524
|
+
}
|
|
18525
|
+
const res = image.resources.get(url);
|
|
18526
|
+
if (res.state !== 'success') {
|
|
18527
|
+
return;
|
|
18528
|
+
}
|
|
18529
|
+
let needRestore = false;
|
|
18530
|
+
if (cornerRadius === 0 || (isArray(cornerRadius) && cornerRadius.every(num => num === 0))) ;
|
|
18531
|
+
else {
|
|
18532
|
+
context.beginPath();
|
|
18533
|
+
createRectPath(context, x, y, width, height, cornerRadius);
|
|
18534
|
+
context.save();
|
|
18535
|
+
context.clip();
|
|
18536
|
+
needRestore = true;
|
|
18537
|
+
}
|
|
18538
|
+
context.setCommonStyle(image, image.attribute, x, y, imageAttribute);
|
|
18539
|
+
let repeat = 0;
|
|
18540
|
+
if (repeatX === 'repeat') {
|
|
18541
|
+
repeat |= 0b0001;
|
|
18542
|
+
}
|
|
18543
|
+
if (repeatY === 'repeat') {
|
|
18544
|
+
repeat |= 0b0010;
|
|
18545
|
+
}
|
|
18546
|
+
if (repeat) {
|
|
18547
|
+
const pattern = context.createPattern(res.data, repeatStr[repeat]);
|
|
18548
|
+
context.fillStyle = pattern;
|
|
18549
|
+
context.translate(x, y, true);
|
|
18550
|
+
context.fillRect(0, 0, width, height);
|
|
18551
|
+
context.translate(-x, -y, true);
|
|
18552
|
+
}
|
|
18553
|
+
else {
|
|
18554
|
+
context.drawImage(res.data, x, y, width, height);
|
|
18555
|
+
}
|
|
18556
|
+
if (needRestore) {
|
|
18557
|
+
context.restore();
|
|
18558
|
+
}
|
|
18285
18559
|
}
|
|
18286
|
-
|
|
18287
|
-
|
|
18560
|
+
}
|
|
18561
|
+
};
|
|
18562
|
+
const _runStroke = () => {
|
|
18563
|
+
if (doStroke) {
|
|
18564
|
+
if (strokeCb) {
|
|
18565
|
+
strokeCb(context, image.attribute, imageAttribute);
|
|
18288
18566
|
}
|
|
18289
|
-
if (
|
|
18290
|
-
context.
|
|
18567
|
+
else if (sVisible) {
|
|
18568
|
+
context.setStrokeStyle(image, image.attribute, originX - x, originY - y, imageAttribute);
|
|
18569
|
+
context.stroke();
|
|
18291
18570
|
}
|
|
18292
18571
|
}
|
|
18572
|
+
};
|
|
18573
|
+
if (!fillStrokeOrder) {
|
|
18574
|
+
_runFill();
|
|
18575
|
+
_runStroke();
|
|
18293
18576
|
}
|
|
18294
|
-
|
|
18295
|
-
|
|
18296
|
-
|
|
18297
|
-
}
|
|
18298
|
-
else if (sVisible) {
|
|
18299
|
-
context.setStrokeStyle(image, image.attribute, originX - x, originY - y, imageAttribute);
|
|
18300
|
-
context.stroke();
|
|
18301
|
-
}
|
|
18577
|
+
else {
|
|
18578
|
+
_runStroke();
|
|
18579
|
+
_runFill();
|
|
18302
18580
|
}
|
|
18303
18581
|
this.afterRenderStep(image, context, x, y, doFill, false, fVisible, false, imageAttribute, drawContext, fillCb);
|
|
18304
18582
|
}
|
|
@@ -18866,7 +19144,7 @@ class CanvasTextLayout {
|
|
|
18866
19144
|
this.textOptions = options;
|
|
18867
19145
|
this.textMeasure = textMeasure;
|
|
18868
19146
|
}
|
|
18869
|
-
LayoutBBox(bbox, textAlign, textBaseline) {
|
|
19147
|
+
LayoutBBox(bbox, textAlign, textBaseline, linesLayout) {
|
|
18870
19148
|
if (textAlign === 'left' || textAlign === 'start') {
|
|
18871
19149
|
bbox.xOffset = 0;
|
|
18872
19150
|
}
|
|
@@ -18886,73 +19164,51 @@ class CanvasTextLayout {
|
|
|
18886
19164
|
bbox.yOffset = bbox.height / -2;
|
|
18887
19165
|
}
|
|
18888
19166
|
else if (textBaseline === 'alphabetic') {
|
|
18889
|
-
|
|
19167
|
+
let percent = 0.79;
|
|
19168
|
+
if (linesLayout.length === 1) {
|
|
19169
|
+
const lineInfo = linesLayout[0];
|
|
19170
|
+
percent = lineInfo.ascent / (lineInfo.ascent + lineInfo.descent);
|
|
19171
|
+
}
|
|
19172
|
+
bbox.yOffset = bbox.height * -percent;
|
|
18890
19173
|
}
|
|
18891
19174
|
else {
|
|
18892
19175
|
bbox.yOffset = -bbox.height;
|
|
18893
19176
|
}
|
|
18894
19177
|
return bbox;
|
|
18895
19178
|
}
|
|
18896
|
-
|
|
18897
|
-
const
|
|
18898
|
-
const bboxWH = [width, height];
|
|
18899
|
-
const bboxOffset = [0, 0];
|
|
18900
|
-
while (str.length > 0) {
|
|
18901
|
-
const { str: clipText } = this.textMeasure.clipTextWithSuffix(str, this.textOptions, width, suffix, wordBreak, suffixPosition);
|
|
18902
|
-
linesLayout.push({
|
|
18903
|
-
str: clipText,
|
|
18904
|
-
width: this.textMeasure.measureTextWidth(clipText, this.textOptions)
|
|
18905
|
-
});
|
|
18906
|
-
str = str.substring(clipText.length);
|
|
18907
|
-
}
|
|
18908
|
-
if (textAlign === 'left' || textAlign === 'start') ;
|
|
18909
|
-
else if (textAlign === 'center') {
|
|
18910
|
-
bboxOffset[0] = bboxWH[0] / -2;
|
|
18911
|
-
}
|
|
18912
|
-
else if (textAlign === 'right' || textAlign === 'end') {
|
|
18913
|
-
bboxOffset[0] = -bboxWH[0];
|
|
18914
|
-
}
|
|
18915
|
-
if (textBaseline === 'top') ;
|
|
18916
|
-
else if (textBaseline === 'middle') {
|
|
18917
|
-
bboxOffset[1] = bboxWH[1] / -2;
|
|
18918
|
-
}
|
|
18919
|
-
else if (textBaseline === 'bottom') {
|
|
18920
|
-
bboxOffset[1] = -bboxWH[1];
|
|
18921
|
-
}
|
|
18922
|
-
const bbox = {
|
|
18923
|
-
xOffset: bboxOffset[0],
|
|
18924
|
-
yOffset: bboxOffset[1],
|
|
18925
|
-
width: bboxWH[0],
|
|
18926
|
-
height: bboxWH[1]
|
|
18927
|
-
};
|
|
18928
|
-
return this.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline, lineHeight);
|
|
18929
|
-
}
|
|
18930
|
-
GetLayoutByLines(lines, textAlign, textBaseline, lineHeight, suffix = '', wordBreak, lineWidth, suffixPosition = 'end') {
|
|
19179
|
+
GetLayoutByLines(lines, textAlign, textBaseline, lineHeight, suffix = '', wordBreak, params) {
|
|
19180
|
+
const { lineWidth, suffixPosition = 'end', measureMode = MeasureModeEnum.actualBounding } = params !== null && params !== void 0 ? params : {};
|
|
18931
19181
|
lines = lines.map(l => l.toString());
|
|
18932
19182
|
const linesLayout = [];
|
|
18933
19183
|
const bboxWH = [0, 0];
|
|
18934
19184
|
if (typeof lineWidth === 'number' && lineWidth !== Infinity) {
|
|
18935
19185
|
let width;
|
|
18936
19186
|
for (let i = 0, len = lines.length; i < len; i++) {
|
|
18937
|
-
|
|
19187
|
+
const metrics = this.textMeasure.measureTextPixelADscentAndWidth(lines[i], this.textOptions, measureMode);
|
|
19188
|
+
width = Math.min(metrics.width, lineWidth);
|
|
18938
19189
|
linesLayout.push({
|
|
18939
|
-
str:
|
|
18940
|
-
|
|
19190
|
+
str: metrics.width <= lineWidth
|
|
19191
|
+
? lines[i].toString()
|
|
19192
|
+
: this.textMeasure.clipTextWithSuffix(lines[i], this.textOptions, width, suffix, wordBreak, suffixPosition).str,
|
|
19193
|
+
width,
|
|
19194
|
+
ascent: metrics.ascent,
|
|
19195
|
+
descent: metrics.descent
|
|
18941
19196
|
});
|
|
18942
19197
|
}
|
|
18943
19198
|
bboxWH[0] = lineWidth;
|
|
18944
19199
|
}
|
|
18945
19200
|
else {
|
|
18946
|
-
|
|
19201
|
+
let _lineWidth = 0;
|
|
18947
19202
|
let width;
|
|
18948
19203
|
let text;
|
|
18949
19204
|
for (let i = 0, len = lines.length; i < len; i++) {
|
|
18950
19205
|
text = lines[i];
|
|
18951
|
-
|
|
18952
|
-
|
|
18953
|
-
|
|
19206
|
+
const metrics = this.textMeasure.measureTextPixelADscentAndWidth(lines[i], this.textOptions, measureMode);
|
|
19207
|
+
width = metrics.width;
|
|
19208
|
+
_lineWidth = Math.max(_lineWidth, width);
|
|
19209
|
+
linesLayout.push({ str: text, width, ascent: metrics.ascent, descent: metrics.descent });
|
|
18954
19210
|
}
|
|
18955
|
-
bboxWH[0] =
|
|
19211
|
+
bboxWH[0] = _lineWidth;
|
|
18956
19212
|
}
|
|
18957
19213
|
bboxWH[1] = linesLayout.length * lineHeight;
|
|
18958
19214
|
bboxWH[0] = linesLayout.reduce((a, b) => Math.max(a, b.width), 0);
|
|
@@ -18962,7 +19218,7 @@ class CanvasTextLayout {
|
|
|
18962
19218
|
width: bboxWH[0],
|
|
18963
19219
|
height: bboxWH[1]
|
|
18964
19220
|
};
|
|
18965
|
-
this.LayoutBBox(bbox, textAlign, textBaseline);
|
|
19221
|
+
this.LayoutBBox(bbox, textAlign, textBaseline, linesLayout);
|
|
18966
19222
|
return this.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline, lineHeight);
|
|
18967
19223
|
}
|
|
18968
19224
|
layoutWithBBox(bbox, lines, textAlign, textBaseline, lineHeight) {
|
|
@@ -18999,7 +19255,18 @@ class CanvasTextLayout {
|
|
|
18999
19255
|
else if (textAlign === 'right' || textAlign === 'end') {
|
|
19000
19256
|
line.leftOffset = bbox.width - line.width;
|
|
19001
19257
|
}
|
|
19002
|
-
line.topOffset =
|
|
19258
|
+
line.topOffset = lineHeight / 2 + (line.ascent - line.descent) / 2 + origin[1];
|
|
19259
|
+
const actualHeight = line.ascent + line.descent;
|
|
19260
|
+
const buf = 0;
|
|
19261
|
+
const actualHeightWithBuf = actualHeight + buf;
|
|
19262
|
+
if (actualHeightWithBuf < lineHeight - buf) {
|
|
19263
|
+
if (textBaseline === 'bottom') {
|
|
19264
|
+
line.topOffset += (lineHeight - actualHeightWithBuf) / 2;
|
|
19265
|
+
}
|
|
19266
|
+
else if (textBaseline === 'top') {
|
|
19267
|
+
line.topOffset -= (lineHeight - actualHeightWithBuf) / 2;
|
|
19268
|
+
}
|
|
19269
|
+
}
|
|
19003
19270
|
origin[1] += lineHeight;
|
|
19004
19271
|
return line;
|
|
19005
19272
|
}
|
|
@@ -19008,6 +19275,7 @@ class CanvasTextLayout {
|
|
|
19008
19275
|
const TEXT_UPDATE_TAG_KEY = [
|
|
19009
19276
|
'text',
|
|
19010
19277
|
'maxLineWidth',
|
|
19278
|
+
'maxWidth',
|
|
19011
19279
|
'textAlign',
|
|
19012
19280
|
'textBaseline',
|
|
19013
19281
|
'heightLimit',
|
|
@@ -19035,20 +19303,14 @@ class Text extends Graphic {
|
|
|
19035
19303
|
var _a;
|
|
19036
19304
|
const attribute = this.attribute;
|
|
19037
19305
|
const textTheme = this.getGraphicTheme();
|
|
19038
|
-
|
|
19039
|
-
|
|
19040
|
-
}
|
|
19041
|
-
const { maxLineWidth = textTheme.maxLineWidth } = attribute;
|
|
19042
|
-
if (!Number.isFinite(maxLineWidth)) {
|
|
19306
|
+
const maxWidth = this.getMaxWidth(textTheme);
|
|
19307
|
+
if (!Number.isFinite(maxWidth)) {
|
|
19043
19308
|
return ((_a = attribute.text) !== null && _a !== void 0 ? _a : textTheme.text).toString();
|
|
19044
19309
|
}
|
|
19045
19310
|
this.tryUpdateAABBBounds();
|
|
19046
19311
|
return this.cache.clipedText;
|
|
19047
19312
|
}
|
|
19048
19313
|
get clipedWidth() {
|
|
19049
|
-
if (!this.isSimplify()) {
|
|
19050
|
-
return undefined;
|
|
19051
|
-
}
|
|
19052
19314
|
this.tryUpdateAABBBounds();
|
|
19053
19315
|
return this.cache.clipedWidth;
|
|
19054
19316
|
}
|
|
@@ -19056,10 +19318,11 @@ class Text extends Graphic {
|
|
|
19056
19318
|
var _a, _b;
|
|
19057
19319
|
const textTheme = this.getGraphicTheme();
|
|
19058
19320
|
const attribute = this.attribute;
|
|
19059
|
-
const
|
|
19060
|
-
if (!Number.isFinite(
|
|
19321
|
+
const maxWidth = this.getMaxWidth(textTheme);
|
|
19322
|
+
if (!Number.isFinite(maxWidth)) {
|
|
19061
19323
|
return false;
|
|
19062
19324
|
}
|
|
19325
|
+
const { text } = this.attribute;
|
|
19063
19326
|
this.tryUpdateAABBBounds();
|
|
19064
19327
|
if ((_b = (_a = this.cache) === null || _a === void 0 ? void 0 : _a.layoutData) === null || _b === void 0 ? void 0 : _b.lines) {
|
|
19065
19328
|
let mergedText = '';
|
|
@@ -19078,15 +19341,9 @@ class Text extends Graphic {
|
|
|
19078
19341
|
return this.clipedText !== attribute.text.toString();
|
|
19079
19342
|
}
|
|
19080
19343
|
get multilineLayout() {
|
|
19081
|
-
if (!this.isMultiLine) {
|
|
19082
|
-
return undefined;
|
|
19083
|
-
}
|
|
19084
19344
|
this.tryUpdateAABBBounds();
|
|
19085
19345
|
return this.cache.layoutData;
|
|
19086
19346
|
}
|
|
19087
|
-
isSimplify() {
|
|
19088
|
-
return !this.isMultiLine && this.attribute.direction !== 'vertical';
|
|
19089
|
-
}
|
|
19090
19347
|
get isMultiLine() {
|
|
19091
19348
|
return Array.isArray(this.attribute.text) || this.attribute.whiteSpace === 'normal';
|
|
19092
19349
|
}
|
|
@@ -19154,13 +19411,73 @@ class Text extends Graphic {
|
|
|
19154
19411
|
transformBoundsWithMatrix(aabbBounds, aabbBounds, this.transMatrix);
|
|
19155
19412
|
return aabbBounds;
|
|
19156
19413
|
}
|
|
19414
|
+
updateSingallineAABBBounds(text) {
|
|
19415
|
+
this.updateMultilineAABBBounds([text]);
|
|
19416
|
+
const layoutData = this.cache.layoutData;
|
|
19417
|
+
if (layoutData) {
|
|
19418
|
+
const line = layoutData.lines[0];
|
|
19419
|
+
this.cache.clipedText = line.str;
|
|
19420
|
+
this.cache.clipedWidth = line.width;
|
|
19421
|
+
}
|
|
19422
|
+
return this._AABBBounds;
|
|
19423
|
+
}
|
|
19424
|
+
updateMultilineAABBBounds(text) {
|
|
19425
|
+
const textTheme = this.getGraphicTheme();
|
|
19426
|
+
const { direction = textTheme.direction, underlineOffset = textTheme.underlineOffset } = this.attribute;
|
|
19427
|
+
const b = direction === 'horizontal'
|
|
19428
|
+
? this.updateHorizontalMultilineAABBBounds(text)
|
|
19429
|
+
: this.updateVerticalMultilineAABBBounds(text);
|
|
19430
|
+
if (direction === 'horizontal') {
|
|
19431
|
+
if (underlineOffset) {
|
|
19432
|
+
this._AABBBounds.add(this._AABBBounds.x1, this._AABBBounds.y2 + underlineOffset);
|
|
19433
|
+
}
|
|
19434
|
+
}
|
|
19435
|
+
return b;
|
|
19436
|
+
}
|
|
19437
|
+
guessLineHeightBuf(fontSize) {
|
|
19438
|
+
return fontSize ? fontSize * 0.1 : 0;
|
|
19439
|
+
}
|
|
19440
|
+
updateHorizontalMultilineAABBBounds(text) {
|
|
19441
|
+
var _a;
|
|
19442
|
+
const textTheme = this.getGraphicTheme();
|
|
19443
|
+
const attribute = this.attribute;
|
|
19444
|
+
const { fontFamily = textTheme.fontFamily, textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline, fontSize = textTheme.fontSize, fontWeight = textTheme.fontWeight, ellipsis = textTheme.ellipsis, maxLineWidth, stroke = textTheme.stroke, wrap = textTheme.wrap, measureMode = textTheme.measureMode, lineWidth = textTheme.lineWidth, whiteSpace = textTheme.whiteSpace, suffixPosition = textTheme.suffixPosition, ignoreBuf = textTheme.ignoreBuf } = attribute;
|
|
19445
|
+
const buf = ignoreBuf ? 0 : this.guessLineHeightBuf(fontSize);
|
|
19446
|
+
const lineHeight = this.getLineHeight(attribute, textTheme) + buf;
|
|
19447
|
+
if (whiteSpace === 'normal' || wrap) {
|
|
19448
|
+
return this.updateWrapAABBBounds(text);
|
|
19449
|
+
}
|
|
19450
|
+
if (!this.shouldUpdateShape() && ((_a = this.cache) === null || _a === void 0 ? void 0 : _a.layoutData)) {
|
|
19451
|
+
const bbox = this.cache.layoutData.bbox;
|
|
19452
|
+
this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);
|
|
19453
|
+
if (stroke) {
|
|
19454
|
+
this._AABBBounds.expand(lineWidth / 2);
|
|
19455
|
+
}
|
|
19456
|
+
return this._AABBBounds;
|
|
19457
|
+
}
|
|
19458
|
+
const textMeasure = application.graphicUtil.textMeasure;
|
|
19459
|
+
const layoutObj = new CanvasTextLayout(fontFamily, { fontSize, fontWeight, fontFamily, lineHeight }, textMeasure);
|
|
19460
|
+
const layoutData = layoutObj.GetLayoutByLines(text, textAlign, textBaseline, lineHeight, ellipsis === true ? textTheme.ellipsis : ellipsis || undefined, false, {
|
|
19461
|
+
lineWidth: maxLineWidth,
|
|
19462
|
+
suffixPosition,
|
|
19463
|
+
measureMode
|
|
19464
|
+
});
|
|
19465
|
+
const { bbox } = layoutData;
|
|
19466
|
+
this.cache.layoutData = layoutData;
|
|
19467
|
+
this.clearUpdateShapeTag();
|
|
19468
|
+
this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);
|
|
19469
|
+
if (stroke) {
|
|
19470
|
+
this._AABBBounds.expand(lineWidth / 2);
|
|
19471
|
+
}
|
|
19472
|
+
return this._AABBBounds;
|
|
19473
|
+
}
|
|
19157
19474
|
updateWrapAABBBounds(text) {
|
|
19158
|
-
var _a, _b, _c
|
|
19475
|
+
var _a, _b, _c;
|
|
19159
19476
|
const textTheme = this.getGraphicTheme();
|
|
19160
|
-
const { fontFamily = textTheme.fontFamily, textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline, fontSize = textTheme.fontSize, ellipsis = textTheme.ellipsis, maxLineWidth, stroke = textTheme.stroke, lineWidth = textTheme.lineWidth, wordBreak = textTheme.wordBreak, fontWeight = textTheme.fontWeight, ignoreBuf = textTheme.ignoreBuf, suffixPosition = textTheme.suffixPosition, heightLimit = 0, lineClamp } = this.attribute;
|
|
19161
|
-
const
|
|
19162
|
-
const
|
|
19163
|
-
if (!this.shouldUpdateShape() && ((
|
|
19477
|
+
const { fontFamily = textTheme.fontFamily, textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline, fontSize = textTheme.fontSize, ellipsis = textTheme.ellipsis, maxLineWidth, stroke = textTheme.stroke, lineWidth = textTheme.lineWidth, wordBreak = textTheme.wordBreak, fontWeight = textTheme.fontWeight, ignoreBuf = textTheme.ignoreBuf, measureMode = textTheme.measureMode, suffixPosition = textTheme.suffixPosition, heightLimit = 0, lineClamp } = this.attribute;
|
|
19478
|
+
const buf = ignoreBuf ? 0 : this.guessLineHeightBuf(fontSize);
|
|
19479
|
+
const lineHeight = this.getLineHeight(this.attribute, textTheme) + buf;
|
|
19480
|
+
if (!this.shouldUpdateShape() && ((_a = this.cache) === null || _a === void 0 ? void 0 : _a.layoutData)) {
|
|
19164
19481
|
const bbox = this.cache.layoutData.bbox;
|
|
19165
19482
|
this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);
|
|
19166
19483
|
if (stroke) {
|
|
@@ -19169,7 +19486,8 @@ class Text extends Graphic {
|
|
|
19169
19486
|
return this._AABBBounds;
|
|
19170
19487
|
}
|
|
19171
19488
|
const textMeasure = application.graphicUtil.textMeasure;
|
|
19172
|
-
const
|
|
19489
|
+
const textOptions = { fontSize, fontWeight, fontFamily, lineHeight };
|
|
19490
|
+
const layoutObj = new CanvasTextLayout(fontFamily, textOptions, textMeasure);
|
|
19173
19491
|
const lines = isArray(text) ? text.map(l => l.toString()) : [text.toString()];
|
|
19174
19492
|
const linesLayout = [];
|
|
19175
19493
|
const bboxWH = [0, 0];
|
|
@@ -19186,19 +19504,22 @@ class Text extends Graphic {
|
|
|
19186
19504
|
const str = lines[i];
|
|
19187
19505
|
let needCut = true;
|
|
19188
19506
|
if (i === lineCountLimit - 1) {
|
|
19189
|
-
const clip =
|
|
19507
|
+
const clip = textMeasure.clipTextWithSuffix(str, textOptions, maxLineWidth, ellipsis, false, suffixPosition, i !== lines.length - 1);
|
|
19508
|
+
const matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);
|
|
19190
19509
|
linesLayout.push({
|
|
19191
19510
|
str: clip.str,
|
|
19192
|
-
width: clip.width
|
|
19511
|
+
width: clip.width,
|
|
19512
|
+
ascent: matrics.ascent,
|
|
19513
|
+
descent: matrics.descent
|
|
19193
19514
|
});
|
|
19194
19515
|
break;
|
|
19195
19516
|
}
|
|
19196
|
-
const clip =
|
|
19517
|
+
const clip = textMeasure.clipText(str, textOptions, maxLineWidth, wordBreak !== 'break-all', wordBreak === 'keep-all');
|
|
19197
19518
|
if ((str !== '' && clip.str === '') || clip.wordBreaked) {
|
|
19198
19519
|
if (ellipsis) {
|
|
19199
|
-
const clipEllipsis =
|
|
19200
|
-
clip.str = (
|
|
19201
|
-
clip.width = (
|
|
19520
|
+
const clipEllipsis = textMeasure.clipTextWithSuffix(str, textOptions, maxLineWidth, ellipsis, false, suffixPosition);
|
|
19521
|
+
clip.str = (_b = clipEllipsis.str) !== null && _b !== void 0 ? _b : '';
|
|
19522
|
+
clip.width = (_c = clipEllipsis.width) !== null && _c !== void 0 ? _c : 0;
|
|
19202
19523
|
}
|
|
19203
19524
|
else {
|
|
19204
19525
|
clip.str = '';
|
|
@@ -19206,9 +19527,12 @@ class Text extends Graphic {
|
|
|
19206
19527
|
}
|
|
19207
19528
|
needCut = false;
|
|
19208
19529
|
}
|
|
19530
|
+
const matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);
|
|
19209
19531
|
linesLayout.push({
|
|
19210
19532
|
str: clip.str,
|
|
19211
|
-
width: clip.width
|
|
19533
|
+
width: clip.width,
|
|
19534
|
+
ascent: matrics.ascent,
|
|
19535
|
+
descent: matrics.descent
|
|
19212
19536
|
});
|
|
19213
19537
|
let cutLength = clip.str.length;
|
|
19214
19538
|
if (clip.wordBreaked && !(str !== '' && clip.str === '')) {
|
|
@@ -19217,10 +19541,7 @@ class Text extends Graphic {
|
|
|
19217
19541
|
}
|
|
19218
19542
|
if (clip.str.length === str.length) ;
|
|
19219
19543
|
else if (needCut) {
|
|
19220
|
-
|
|
19221
|
-
if (wordBreak === 'keep-all') {
|
|
19222
|
-
newStr = newStr.replace(/^\s+/g, '');
|
|
19223
|
-
}
|
|
19544
|
+
const newStr = str.substring(cutLength);
|
|
19224
19545
|
lines.splice(i + 1, 0, newStr);
|
|
19225
19546
|
}
|
|
19226
19547
|
}
|
|
@@ -19237,29 +19558,33 @@ class Text extends Graphic {
|
|
|
19237
19558
|
let text;
|
|
19238
19559
|
for (let i = 0, len = lines.length; i < len; i++) {
|
|
19239
19560
|
if (i === lineCountLimit - 1) {
|
|
19240
|
-
const clip =
|
|
19561
|
+
const clip = textMeasure.clipTextWithSuffix(lines[i], textOptions, maxLineWidth, ellipsis, false, suffixPosition);
|
|
19562
|
+
const matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);
|
|
19241
19563
|
linesLayout.push({
|
|
19242
19564
|
str: clip.str,
|
|
19243
|
-
width: clip.width
|
|
19565
|
+
width: clip.width,
|
|
19566
|
+
ascent: matrics.ascent,
|
|
19567
|
+
descent: matrics.descent
|
|
19244
19568
|
});
|
|
19245
19569
|
lineWidth = Math.max(lineWidth, clip.width);
|
|
19246
19570
|
break;
|
|
19247
19571
|
}
|
|
19248
19572
|
text = lines[i];
|
|
19249
|
-
width =
|
|
19573
|
+
width = textMeasure.measureTextWidth(text, textOptions);
|
|
19250
19574
|
lineWidth = Math.max(lineWidth, width);
|
|
19251
|
-
|
|
19575
|
+
const matrics = textMeasure.measureTextPixelADscentAndWidth(text, textOptions, measureMode);
|
|
19576
|
+
linesLayout.push({ str: text, width, ascent: matrics.ascent, descent: matrics.descent });
|
|
19252
19577
|
}
|
|
19253
19578
|
bboxWH[0] = lineWidth;
|
|
19254
19579
|
}
|
|
19255
|
-
bboxWH[1] = linesLayout.length *
|
|
19580
|
+
bboxWH[1] = linesLayout.length * lineHeight;
|
|
19256
19581
|
const bbox = {
|
|
19257
19582
|
xOffset: 0,
|
|
19258
19583
|
yOffset: 0,
|
|
19259
19584
|
width: bboxWH[0],
|
|
19260
19585
|
height: bboxWH[1]
|
|
19261
19586
|
};
|
|
19262
|
-
layoutObj.LayoutBBox(bbox, textAlign, textBaseline);
|
|
19587
|
+
layoutObj.LayoutBBox(bbox, textAlign, textBaseline, linesLayout);
|
|
19263
19588
|
const layoutData = layoutObj.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline, lineHeight);
|
|
19264
19589
|
this.cache.layoutData = layoutData;
|
|
19265
19590
|
this.clearUpdateShapeTag();
|
|
@@ -19269,212 +19594,19 @@ class Text extends Graphic {
|
|
|
19269
19594
|
}
|
|
19270
19595
|
return this._AABBBounds;
|
|
19271
19596
|
}
|
|
19272
|
-
updateSingallineAABBBounds(text) {
|
|
19273
|
-
const textTheme = this.getGraphicTheme();
|
|
19274
|
-
const { direction = textTheme.direction, underlineOffset = textTheme.underlineOffset } = this.attribute;
|
|
19275
|
-
const b = direction === 'horizontal'
|
|
19276
|
-
? this.updateHorizontalSinglelineAABBBounds(text)
|
|
19277
|
-
: this.updateVerticalSinglelineAABBBounds(text);
|
|
19278
|
-
if (direction === 'horizontal') {
|
|
19279
|
-
if (underlineOffset) {
|
|
19280
|
-
this._AABBBounds.add(this._AABBBounds.x1, this._AABBBounds.y2 + underlineOffset);
|
|
19281
|
-
}
|
|
19282
|
-
}
|
|
19283
|
-
return b;
|
|
19284
|
-
}
|
|
19285
|
-
updateMultilineAABBBounds(text) {
|
|
19286
|
-
const textTheme = this.getGraphicTheme();
|
|
19287
|
-
const { direction = textTheme.direction, underlineOffset = textTheme.underlineOffset } = this.attribute;
|
|
19288
|
-
const b = direction === 'horizontal'
|
|
19289
|
-
? this.updateHorizontalMultilineAABBBounds(text)
|
|
19290
|
-
: this.updateVerticalMultilineAABBBounds(text);
|
|
19291
|
-
if (direction === 'horizontal') {
|
|
19292
|
-
if (underlineOffset) {
|
|
19293
|
-
this._AABBBounds.add(this._AABBBounds.x1, this._AABBBounds.y2 + underlineOffset);
|
|
19294
|
-
}
|
|
19295
|
-
}
|
|
19296
|
-
return b;
|
|
19297
|
-
}
|
|
19298
|
-
updateHorizontalSinglelineAABBBounds(text) {
|
|
19299
|
-
var _a, _b;
|
|
19300
|
-
const textTheme = this.getGraphicTheme();
|
|
19301
|
-
const { wrap = textTheme.wrap } = this.attribute;
|
|
19302
|
-
if (wrap) {
|
|
19303
|
-
return this.updateWrapAABBBounds([text]);
|
|
19304
|
-
}
|
|
19305
|
-
const textMeasure = application.graphicUtil.textMeasure;
|
|
19306
|
-
let width;
|
|
19307
|
-
let str;
|
|
19308
|
-
const attribute = this.attribute;
|
|
19309
|
-
const { maxLineWidth = textTheme.maxLineWidth, ellipsis = textTheme.ellipsis, textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline, fontFamily = textTheme.fontFamily, fontSize = textTheme.fontSize, fontWeight = textTheme.fontWeight, stroke = textTheme.stroke, lineWidth = textTheme.lineWidth, ignoreBuf = textTheme.ignoreBuf, whiteSpace = textTheme.whiteSpace, suffixPosition = textTheme.suffixPosition } = attribute;
|
|
19310
|
-
if (whiteSpace === 'normal') {
|
|
19311
|
-
return this.updateWrapAABBBounds(text);
|
|
19312
|
-
}
|
|
19313
|
-
const buf = ignoreBuf ? 0 : Math.max(2, fontSize * 0.075);
|
|
19314
|
-
const textFontSize = attribute.fontSize || textTheme.fontSize;
|
|
19315
|
-
const lineHeight = (_a = calculateLineHeight(attribute.lineHeight, textFontSize)) !== null && _a !== void 0 ? _a : textFontSize + buf;
|
|
19316
|
-
if (!this.shouldUpdateShape() && this.cache) {
|
|
19317
|
-
width = (_b = this.cache.clipedWidth) !== null && _b !== void 0 ? _b : 0;
|
|
19318
|
-
const dx = textDrawOffsetX(textAlign, width);
|
|
19319
|
-
const dy = textLayoutOffsetY(textBaseline, lineHeight, fontSize);
|
|
19320
|
-
this._AABBBounds.set(dx, dy, dx + width, dy + lineHeight);
|
|
19321
|
-
if (stroke) {
|
|
19322
|
-
this._AABBBounds.expand(lineWidth / 2);
|
|
19323
|
-
}
|
|
19324
|
-
return this._AABBBounds;
|
|
19325
|
-
}
|
|
19326
|
-
if (Number.isFinite(maxLineWidth)) {
|
|
19327
|
-
if (ellipsis) {
|
|
19328
|
-
const strEllipsis = (ellipsis === true ? textTheme.ellipsis : ellipsis);
|
|
19329
|
-
const data = textMeasure.clipTextWithSuffix(text.toString(), { fontSize, fontWeight, fontFamily }, maxLineWidth, strEllipsis, false, suffixPosition);
|
|
19330
|
-
str = data.str;
|
|
19331
|
-
width = data.width;
|
|
19332
|
-
}
|
|
19333
|
-
else {
|
|
19334
|
-
const data = textMeasure.clipText(text.toString(), { fontSize, fontWeight, fontFamily }, maxLineWidth, false);
|
|
19335
|
-
str = data.str;
|
|
19336
|
-
width = data.width;
|
|
19337
|
-
}
|
|
19338
|
-
this.cache.clipedText = str;
|
|
19339
|
-
this.cache.clipedWidth = width;
|
|
19340
|
-
}
|
|
19341
|
-
else {
|
|
19342
|
-
width = textMeasure.measureTextWidth(text.toString(), { fontSize, fontWeight, fontFamily });
|
|
19343
|
-
this.cache.clipedText = text.toString();
|
|
19344
|
-
this.cache.clipedWidth = width;
|
|
19345
|
-
}
|
|
19346
|
-
this.clearUpdateShapeTag();
|
|
19347
|
-
const dx = textDrawOffsetX(textAlign, width);
|
|
19348
|
-
let lh = lineHeight;
|
|
19349
|
-
if (application.global && application.global.isSafari()) {
|
|
19350
|
-
lh += fontSize * 0.2;
|
|
19351
|
-
}
|
|
19352
|
-
const dy = textLayoutOffsetY(textBaseline, lh, fontSize, buf);
|
|
19353
|
-
this._AABBBounds.set(dx, dy, dx + width, dy + lh);
|
|
19354
|
-
if (stroke) {
|
|
19355
|
-
this._AABBBounds.expand(lineWidth / 2);
|
|
19356
|
-
}
|
|
19357
|
-
return this._AABBBounds;
|
|
19358
|
-
}
|
|
19359
|
-
getBaselineMapAlign() {
|
|
19360
|
-
return Text.baselineMapAlign;
|
|
19361
|
-
}
|
|
19362
|
-
getAlignMapBaseline() {
|
|
19363
|
-
return Text.alignMapBaseline;
|
|
19364
|
-
}
|
|
19365
|
-
updateVerticalSinglelineAABBBounds(text) {
|
|
19366
|
-
var _a, _b, _c;
|
|
19367
|
-
const textTheme = this.getGraphicTheme();
|
|
19368
|
-
const textMeasure = application.graphicUtil.textMeasure;
|
|
19369
|
-
let width;
|
|
19370
|
-
const attribute = this.attribute;
|
|
19371
|
-
const { ignoreBuf = textTheme.ignoreBuf } = attribute;
|
|
19372
|
-
const buf = ignoreBuf ? 0 : 2;
|
|
19373
|
-
const { maxLineWidth = textTheme.maxLineWidth, ellipsis = textTheme.ellipsis, fontSize = textTheme.fontSize, fontWeight = textTheme.fontWeight, fontFamily = textTheme.fontFamily, stroke = textTheme.stroke, lineWidth = textTheme.lineWidth, verticalMode = textTheme.verticalMode, suffixPosition = textTheme.suffixPosition } = attribute;
|
|
19374
|
-
const lineHeight = (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) !== null && _a !== void 0 ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
|
|
19375
|
-
let { textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline } = attribute;
|
|
19376
|
-
if (!verticalMode) {
|
|
19377
|
-
const t = textAlign;
|
|
19378
|
-
textAlign = (_b = Text.baselineMapAlign[textBaseline]) !== null && _b !== void 0 ? _b : 'left';
|
|
19379
|
-
textBaseline = (_c = Text.alignMapBaseline[t]) !== null && _c !== void 0 ? _c : 'top';
|
|
19380
|
-
}
|
|
19381
|
-
if (!this.shouldUpdateShape() && this.cache) {
|
|
19382
|
-
width = this.cache.clipedWidth;
|
|
19383
|
-
const dx = textDrawOffsetX(textAlign, width);
|
|
19384
|
-
const dy = textLayoutOffsetY(textBaseline, lineHeight, fontSize);
|
|
19385
|
-
this._AABBBounds.set(dy, dx, dy + lineHeight, dx + width);
|
|
19386
|
-
if (stroke) {
|
|
19387
|
-
this._AABBBounds.expand(lineWidth / 2);
|
|
19388
|
-
}
|
|
19389
|
-
return this._AABBBounds;
|
|
19390
|
-
}
|
|
19391
|
-
let verticalList = [
|
|
19392
|
-
verticalLayout(text.toString())
|
|
19393
|
-
];
|
|
19394
|
-
if (Number.isFinite(maxLineWidth)) {
|
|
19395
|
-
if (ellipsis) {
|
|
19396
|
-
const strEllipsis = (ellipsis === true ? textTheme.ellipsis : ellipsis);
|
|
19397
|
-
const data = textMeasure.clipTextWithSuffixVertical(verticalList[0], { fontSize, fontWeight, fontFamily }, maxLineWidth, strEllipsis, false, suffixPosition);
|
|
19398
|
-
verticalList = [data.verticalList];
|
|
19399
|
-
width = data.width;
|
|
19400
|
-
}
|
|
19401
|
-
else {
|
|
19402
|
-
const data = textMeasure.clipTextVertical(verticalList[0], { fontSize, fontWeight, fontFamily }, maxLineWidth, false);
|
|
19403
|
-
verticalList = [data.verticalList];
|
|
19404
|
-
width = data.width;
|
|
19405
|
-
}
|
|
19406
|
-
this.cache.verticalList = verticalList;
|
|
19407
|
-
this.cache.clipedWidth = width;
|
|
19408
|
-
}
|
|
19409
|
-
else {
|
|
19410
|
-
width = 0;
|
|
19411
|
-
verticalList[0].forEach(t => {
|
|
19412
|
-
const w = t.direction === TextDirection.HORIZONTAL
|
|
19413
|
-
? fontSize
|
|
19414
|
-
: textMeasure.measureTextWidth(t.text, { fontSize, fontWeight, fontFamily });
|
|
19415
|
-
width += w;
|
|
19416
|
-
t.width = w;
|
|
19417
|
-
});
|
|
19418
|
-
this.cache.verticalList = verticalList;
|
|
19419
|
-
this.cache.clipedWidth = width;
|
|
19420
|
-
}
|
|
19421
|
-
this.clearUpdateShapeTag();
|
|
19422
|
-
const dx = textDrawOffsetX(textAlign, width);
|
|
19423
|
-
const dy = textLayoutOffsetY(textBaseline, lineHeight, fontSize);
|
|
19424
|
-
this._AABBBounds.set(dy, dx, dy + lineHeight, dx + width);
|
|
19425
|
-
if (stroke) {
|
|
19426
|
-
this._AABBBounds.expand(lineWidth / 2);
|
|
19427
|
-
}
|
|
19428
|
-
return this._AABBBounds;
|
|
19429
|
-
}
|
|
19430
|
-
updateHorizontalMultilineAABBBounds(text) {
|
|
19431
|
-
var _a, _b;
|
|
19432
|
-
const textTheme = this.getGraphicTheme();
|
|
19433
|
-
const { wrap = textTheme.wrap } = this.attribute;
|
|
19434
|
-
if (wrap) {
|
|
19435
|
-
return this.updateWrapAABBBounds(text);
|
|
19436
|
-
}
|
|
19437
|
-
const attribute = this.attribute;
|
|
19438
|
-
const { fontFamily = textTheme.fontFamily, textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline, fontSize = textTheme.fontSize, fontWeight = textTheme.fontWeight, ellipsis = textTheme.ellipsis, maxLineWidth, stroke = textTheme.stroke, lineWidth = textTheme.lineWidth, whiteSpace = textTheme.whiteSpace, suffixPosition = textTheme.suffixPosition } = attribute;
|
|
19439
|
-
const lineHeight = (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) !== null && _a !== void 0 ? _a : (attribute.fontSize || textTheme.fontSize);
|
|
19440
|
-
if (whiteSpace === 'normal') {
|
|
19441
|
-
return this.updateWrapAABBBounds(text);
|
|
19442
|
-
}
|
|
19443
|
-
if (!this.shouldUpdateShape() && ((_b = this.cache) === null || _b === void 0 ? void 0 : _b.layoutData)) {
|
|
19444
|
-
const bbox = this.cache.layoutData.bbox;
|
|
19445
|
-
this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);
|
|
19446
|
-
if (stroke) {
|
|
19447
|
-
this._AABBBounds.expand(lineWidth / 2);
|
|
19448
|
-
}
|
|
19449
|
-
return this._AABBBounds;
|
|
19450
|
-
}
|
|
19451
|
-
const textMeasure = application.graphicUtil.textMeasure;
|
|
19452
|
-
const layoutObj = new CanvasTextLayout(fontFamily, { fontSize, fontWeight, fontFamily }, textMeasure);
|
|
19453
|
-
const layoutData = layoutObj.GetLayoutByLines(text, textAlign, textBaseline, lineHeight, ellipsis === true ? textTheme.ellipsis : ellipsis || undefined, false, maxLineWidth, suffixPosition);
|
|
19454
|
-
const { bbox } = layoutData;
|
|
19455
|
-
this.cache.layoutData = layoutData;
|
|
19456
|
-
this.clearUpdateShapeTag();
|
|
19457
|
-
this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);
|
|
19458
|
-
if (stroke) {
|
|
19459
|
-
this._AABBBounds.expand(lineWidth / 2);
|
|
19460
|
-
}
|
|
19461
|
-
return this._AABBBounds;
|
|
19462
|
-
}
|
|
19463
19597
|
updateVerticalMultilineAABBBounds(text) {
|
|
19464
|
-
var _a, _b
|
|
19598
|
+
var _a, _b;
|
|
19465
19599
|
const textTheme = this.getGraphicTheme();
|
|
19466
19600
|
const textMeasure = application.graphicUtil.textMeasure;
|
|
19467
19601
|
let width;
|
|
19468
19602
|
const attribute = this.attribute;
|
|
19469
|
-
const { ignoreBuf = textTheme.ignoreBuf } = attribute;
|
|
19470
|
-
const buf = ignoreBuf ? 0 : 2;
|
|
19471
19603
|
const { maxLineWidth = textTheme.maxLineWidth, ellipsis = textTheme.ellipsis, fontFamily = textTheme.fontFamily, fontSize = textTheme.fontSize, fontWeight = textTheme.fontWeight, stroke = textTheme.stroke, lineWidth = textTheme.lineWidth, verticalMode = textTheme.verticalMode, suffixPosition = textTheme.suffixPosition } = attribute;
|
|
19472
|
-
const lineHeight = (
|
|
19604
|
+
const lineHeight = this.getLineHeight(attribute, textTheme);
|
|
19473
19605
|
let { textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline } = attribute;
|
|
19474
19606
|
if (!verticalMode) {
|
|
19475
19607
|
const t = textAlign;
|
|
19476
|
-
textAlign = (
|
|
19477
|
-
textBaseline = (
|
|
19608
|
+
textAlign = (_a = Text.baselineMapAlign[textBaseline]) !== null && _a !== void 0 ? _a : 'left';
|
|
19609
|
+
textBaseline = (_b = Text.alignMapBaseline[t]) !== null && _b !== void 0 ? _b : 'top';
|
|
19478
19610
|
}
|
|
19479
19611
|
width = 0;
|
|
19480
19612
|
if (!this.shouldUpdateShape() && this.cache) {
|
|
@@ -19534,6 +19666,15 @@ class Text extends Graphic {
|
|
|
19534
19666
|
}
|
|
19535
19667
|
return this._AABBBounds;
|
|
19536
19668
|
}
|
|
19669
|
+
getMaxWidth(theme) {
|
|
19670
|
+
var _a, _b;
|
|
19671
|
+
const attribute = this.attribute;
|
|
19672
|
+
return (_b = (_a = attribute.maxLineWidth) !== null && _a !== void 0 ? _a : attribute.maxWidth) !== null && _b !== void 0 ? _b : theme.maxWidth;
|
|
19673
|
+
}
|
|
19674
|
+
getLineHeight(attribute, textTheme) {
|
|
19675
|
+
var _a;
|
|
19676
|
+
return ((_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) !== null && _a !== void 0 ? _a : (attribute.fontSize || textTheme.fontSize));
|
|
19677
|
+
}
|
|
19537
19678
|
needUpdateTags(keys, k = TEXT_UPDATE_TAG_KEY) {
|
|
19538
19679
|
return super.needUpdateTags(keys, k);
|
|
19539
19680
|
}
|
|
@@ -19546,6 +19687,12 @@ class Text extends Graphic {
|
|
|
19546
19687
|
getNoWorkAnimateAttr() {
|
|
19547
19688
|
return Text.NOWORK_ANIMATE_ATTR;
|
|
19548
19689
|
}
|
|
19690
|
+
getBaselineMapAlign() {
|
|
19691
|
+
return Text.baselineMapAlign;
|
|
19692
|
+
}
|
|
19693
|
+
getAlignMapBaseline() {
|
|
19694
|
+
return Text.alignMapBaseline;
|
|
19695
|
+
}
|
|
19549
19696
|
}
|
|
19550
19697
|
Text.NOWORK_ANIMATE_ATTR = Object.assign({ ellipsis: 1, wordBreak: 1, direction: 1, textAlign: 1, textBaseline: 1, fontFamily: 1, fontWeight: 1 }, NOWORK_ANIMATE_ATTR);
|
|
19551
19698
|
Text.baselineMapAlign = {
|
|
@@ -19609,7 +19756,9 @@ class WrapText extends Text {
|
|
|
19609
19756
|
const clip = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, false, suffixPosition);
|
|
19610
19757
|
linesLayout.push({
|
|
19611
19758
|
str: clip.str,
|
|
19612
|
-
width: clip.width
|
|
19759
|
+
width: clip.width,
|
|
19760
|
+
ascent: 0,
|
|
19761
|
+
descent: 0
|
|
19613
19762
|
});
|
|
19614
19763
|
break;
|
|
19615
19764
|
}
|
|
@@ -19628,7 +19777,9 @@ class WrapText extends Text {
|
|
|
19628
19777
|
}
|
|
19629
19778
|
linesLayout.push({
|
|
19630
19779
|
str: clip.str,
|
|
19631
|
-
width: clip.width
|
|
19780
|
+
width: clip.width,
|
|
19781
|
+
ascent: 0,
|
|
19782
|
+
descent: 0
|
|
19632
19783
|
});
|
|
19633
19784
|
if (clip.str.length === str.length) ;
|
|
19634
19785
|
else if (needCut) {
|
|
@@ -19652,7 +19803,9 @@ class WrapText extends Text {
|
|
|
19652
19803
|
const clip = layoutObj.textMeasure.clipTextWithSuffix(lines[i], layoutObj.textOptions, maxLineWidth, ellipsis, false, suffixPosition);
|
|
19653
19804
|
linesLayout.push({
|
|
19654
19805
|
str: clip.str,
|
|
19655
|
-
width: clip.width
|
|
19806
|
+
width: clip.width,
|
|
19807
|
+
ascent: 0,
|
|
19808
|
+
descent: 0
|
|
19656
19809
|
});
|
|
19657
19810
|
lineWidth = Math.max(lineWidth, clip.width);
|
|
19658
19811
|
break;
|
|
@@ -19660,7 +19813,7 @@ class WrapText extends Text {
|
|
|
19660
19813
|
text = lines[i];
|
|
19661
19814
|
width = layoutObj.textMeasure.measureTextWidth(text, layoutObj.textOptions, wordBreak === 'break-word');
|
|
19662
19815
|
lineWidth = Math.max(lineWidth, width);
|
|
19663
|
-
linesLayout.push({ str: text, width });
|
|
19816
|
+
linesLayout.push({ str: text, width, ascent: 0, descent: 0 });
|
|
19664
19817
|
}
|
|
19665
19818
|
bboxWH[0] = lineWidth;
|
|
19666
19819
|
}
|
|
@@ -19723,6 +19876,9 @@ class BaseSymbol {
|
|
|
19723
19876
|
bounds.y2 = size[1] / 2;
|
|
19724
19877
|
}
|
|
19725
19878
|
}
|
|
19879
|
+
parseSize(size) {
|
|
19880
|
+
return isNumber(size) ? size : Math.min(size[0], size[1]);
|
|
19881
|
+
}
|
|
19726
19882
|
}
|
|
19727
19883
|
|
|
19728
19884
|
function circle(ctx, r, x, y, z) {
|
|
@@ -19741,15 +19897,15 @@ class CircleSymbol extends BaseSymbol {
|
|
|
19741
19897
|
this.pathStr = 'M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0';
|
|
19742
19898
|
}
|
|
19743
19899
|
draw(ctx, size, x, y, z) {
|
|
19744
|
-
const r = size / 2;
|
|
19900
|
+
const r = this.parseSize(size) / 2;
|
|
19745
19901
|
return circle(ctx, r, x, y, z);
|
|
19746
19902
|
}
|
|
19747
19903
|
drawOffset(ctx, size, x, y, offset, z) {
|
|
19748
|
-
const r = size / 2 + offset;
|
|
19904
|
+
const r = this.parseSize(size) / 2 + offset;
|
|
19749
19905
|
return circle(ctx, r, x, y, z);
|
|
19750
19906
|
}
|
|
19751
19907
|
drawToSvgPath(size, x, y, z) {
|
|
19752
|
-
const r = size / 2;
|
|
19908
|
+
const r = this.parseSize(size) / 2;
|
|
19753
19909
|
return `M ${x - r}, ${y} a ${r},${r} 0 1,0 ${r * 2},0 a ${r},${r} 0 1,0 -${r * 2},0`;
|
|
19754
19910
|
}
|
|
19755
19911
|
}
|
|
@@ -19794,11 +19950,11 @@ class CrossSymbol extends BaseSymbol {
|
|
|
19794
19950
|
this.pathStr = 'M-0.5,-0.2L-0.5,0.2L-0.2,0.2L-0.2,0.5L0.2,0.5L0.2,0.2L0.5,0.2L0.5,-0.2L0.2,-0.2L0.2,-0.5L-0.2,-0.5L-0.2,-0.2Z';
|
|
19795
19951
|
}
|
|
19796
19952
|
draw(ctx, size, x, y, z) {
|
|
19797
|
-
const r = size / 6;
|
|
19953
|
+
const r = this.parseSize(size) / 6;
|
|
19798
19954
|
return cross(ctx, r, x, y, z);
|
|
19799
19955
|
}
|
|
19800
19956
|
drawOffset(ctx, size, x, y, offset, z) {
|
|
19801
|
-
const r = size / 6;
|
|
19957
|
+
const r = this.parseSize(size) / 6;
|
|
19802
19958
|
return crossOffset(ctx, r, x, y, offset, z);
|
|
19803
19959
|
}
|
|
19804
19960
|
}
|
|
@@ -19819,15 +19975,15 @@ class DiamondSymbol extends BaseSymbol {
|
|
|
19819
19975
|
this.pathStr = 'M-0.5,0L0,-0.5L0.5,0L0,0.5Z';
|
|
19820
19976
|
}
|
|
19821
19977
|
draw(ctx, size, x, y, z) {
|
|
19822
|
-
const r = size / 2;
|
|
19978
|
+
const r = this.parseSize(size) / 2;
|
|
19823
19979
|
return diamond(ctx, r, x, y, z);
|
|
19824
19980
|
}
|
|
19825
19981
|
drawFitDir(ctx, size, x, y, z) {
|
|
19826
|
-
const r = size / 2;
|
|
19982
|
+
const r = this.parseSize(size) / 2;
|
|
19827
19983
|
return diamond(ctx, r, x, y, z);
|
|
19828
19984
|
}
|
|
19829
19985
|
drawOffset(ctx, size, x, y, offset, z) {
|
|
19830
|
-
const r = size / 2 + offset;
|
|
19986
|
+
const r = this.parseSize(size) / 2 + offset;
|
|
19831
19987
|
return diamond(ctx, r, x, y, z);
|
|
19832
19988
|
}
|
|
19833
19989
|
}
|
|
@@ -19845,11 +20001,11 @@ class SquareSymbol extends BaseSymbol {
|
|
|
19845
20001
|
this.pathStr = 'M-0.5,-0.5h1v1h-1Z';
|
|
19846
20002
|
}
|
|
19847
20003
|
draw(ctx, size, x, y) {
|
|
19848
|
-
const r = size / 2;
|
|
20004
|
+
const r = this.parseSize(size) / 2;
|
|
19849
20005
|
return square(ctx, r, x, y);
|
|
19850
20006
|
}
|
|
19851
20007
|
drawOffset(ctx, size, x, y, offset) {
|
|
19852
|
-
const r = size / 2 + offset;
|
|
20008
|
+
const r = this.parseSize(size) / 2 + offset;
|
|
19853
20009
|
return square(ctx, r, x, y);
|
|
19854
20010
|
}
|
|
19855
20011
|
}
|
|
@@ -19869,11 +20025,11 @@ class TriangleUpSymbol extends BaseSymbol {
|
|
|
19869
20025
|
this.pathStr = 'M0.5,0.5 L-0.5,0.5 L0,-0.5 Z';
|
|
19870
20026
|
}
|
|
19871
20027
|
draw(ctx, size, x, y) {
|
|
19872
|
-
const r = size / 2;
|
|
20028
|
+
const r = this.parseSize(size) / 2;
|
|
19873
20029
|
return trianglUpOffset(ctx, r, x, y);
|
|
19874
20030
|
}
|
|
19875
20031
|
drawOffset(ctx, size, x, y, offset) {
|
|
19876
|
-
const r = size / 2;
|
|
20032
|
+
const r = this.parseSize(size) / 2;
|
|
19877
20033
|
return trianglUpOffset(ctx, r, x, y, offset);
|
|
19878
20034
|
}
|
|
19879
20035
|
}
|
|
@@ -19912,11 +20068,11 @@ class StarSymbol extends BaseSymbol {
|
|
|
19912
20068
|
this.pathStr = 'M0 -1L0.22451398828979266 -0.3090169943749474L0.9510565162951535 -0.30901699437494745L0.3632712640026804 0.1180339887498948L0.5877852522924732 0.8090169943749473L8.326672684688674e-17 0.3819660112501051L-0.587785252292473 0.8090169943749476L-0.3632712640026804 0.11803398874989487L-0.9510565162951536 -0.30901699437494723L-0.22451398828979274 -0.30901699437494734Z';
|
|
19913
20069
|
}
|
|
19914
20070
|
draw(ctx, size, transX, transY) {
|
|
19915
|
-
const r = size / 2;
|
|
20071
|
+
const r = this.parseSize(size) / 2;
|
|
19916
20072
|
return star(ctx, r, transX, transY);
|
|
19917
20073
|
}
|
|
19918
20074
|
drawOffset(ctx, size, transX, transY, offset) {
|
|
19919
|
-
const r = size / 2 + offset;
|
|
20075
|
+
const r = this.parseSize(size) / 2 + offset;
|
|
19920
20076
|
return star(ctx, r, transX, transY);
|
|
19921
20077
|
}
|
|
19922
20078
|
}
|
|
@@ -19945,11 +20101,11 @@ class ArrowSymbol extends BaseSymbol {
|
|
|
19945
20101
|
this.pathStr = 'M-0.07142857142857142,0.5L0.07142857142857142,0.5L0.07142857142857142,-0.0625L0.2,-0.0625L0,-0.5L-0.2,-0.0625L-0.07142857142857142,-0.0625Z';
|
|
19946
20102
|
}
|
|
19947
20103
|
draw(ctx, size, transX, transY) {
|
|
19948
|
-
const r = size / 2;
|
|
20104
|
+
const r = this.parseSize(size) / 2;
|
|
19949
20105
|
return arrow(ctx, r, transX, transY);
|
|
19950
20106
|
}
|
|
19951
20107
|
drawOffset(ctx, size, transX, transY, offset) {
|
|
19952
|
-
const r = size / 2 + offset;
|
|
20108
|
+
const r = this.parseSize(size) / 2 + offset;
|
|
19953
20109
|
return arrow(ctx, r, transX, transY);
|
|
19954
20110
|
}
|
|
19955
20111
|
}
|
|
@@ -19970,11 +20126,11 @@ class WedgeSymbol extends BaseSymbol {
|
|
|
19970
20126
|
this.pathStr = 'M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z';
|
|
19971
20127
|
}
|
|
19972
20128
|
draw(ctx, size, transX, transY) {
|
|
19973
|
-
const r = size / 2;
|
|
20129
|
+
const r = this.parseSize(size) / 2;
|
|
19974
20130
|
return wedge(ctx, r, transX, transY);
|
|
19975
20131
|
}
|
|
19976
20132
|
drawOffset(ctx, size, transX, transY, offset) {
|
|
19977
|
-
const r = size / 2 + offset;
|
|
20133
|
+
const r = this.parseSize(size) / 2 + offset;
|
|
19978
20134
|
return wedge(ctx, r, transX, transY);
|
|
19979
20135
|
}
|
|
19980
20136
|
}
|
|
@@ -19992,11 +20148,11 @@ class StrokeSymbol extends BaseSymbol {
|
|
|
19992
20148
|
this.pathStr = '';
|
|
19993
20149
|
}
|
|
19994
20150
|
draw(ctx, size, transX, transY) {
|
|
19995
|
-
const r = size / 2;
|
|
20151
|
+
const r = this.parseSize(size) / 2;
|
|
19996
20152
|
return stroke(ctx, r, transX, transY);
|
|
19997
20153
|
}
|
|
19998
20154
|
drawOffset(ctx, size, transX, transY, offset) {
|
|
19999
|
-
const r = size / 2 + offset;
|
|
20155
|
+
const r = this.parseSize(size) / 2 + offset;
|
|
20000
20156
|
return stroke(ctx, r, transX, transY);
|
|
20001
20157
|
}
|
|
20002
20158
|
}
|
|
@@ -20031,11 +20187,11 @@ class WyeSymbol extends BaseSymbol {
|
|
|
20031
20187
|
this.pathStr = 'M0.25 0.14433756729740646L0.25 0.6443375672974064L-0.25 0.6443375672974064L-0.25 0.14433756729740643L-0.6830127018922193 -0.10566243270259357L-0.4330127018922193 -0.5386751345948129L0 -0.28867513459481287L0.4330127018922193 -0.5386751345948129L0.6830127018922193 -0.10566243270259357Z';
|
|
20032
20188
|
}
|
|
20033
20189
|
draw(ctx, size, transX, transY) {
|
|
20034
|
-
const r = size / 2;
|
|
20190
|
+
const r = this.parseSize(size) / 2;
|
|
20035
20191
|
return wye(ctx, r, transX, transY);
|
|
20036
20192
|
}
|
|
20037
20193
|
drawOffset(ctx, size, transX, transY, offset) {
|
|
20038
|
-
const r = size / 2 + offset;
|
|
20194
|
+
const r = this.parseSize(size) / 2 + offset;
|
|
20039
20195
|
return wye(ctx, r, transX, transY);
|
|
20040
20196
|
}
|
|
20041
20197
|
}
|
|
@@ -20055,11 +20211,11 @@ class TriangleLeftSymbol extends BaseSymbol {
|
|
|
20055
20211
|
this.pathStr = 'M-0.5,0 L0.5,0.5 L0.5,-0.5 Z';
|
|
20056
20212
|
}
|
|
20057
20213
|
draw(ctx, size, x, y) {
|
|
20058
|
-
const r = size / 2;
|
|
20214
|
+
const r = this.parseSize(size) / 2;
|
|
20059
20215
|
return trianglLeftOffset(ctx, r, x, y, 0);
|
|
20060
20216
|
}
|
|
20061
20217
|
drawOffset(ctx, size, x, y, offset) {
|
|
20062
|
-
const r = size / 2;
|
|
20218
|
+
const r = this.parseSize(size) / 2;
|
|
20063
20219
|
return trianglLeftOffset(ctx, r, x, y, offset);
|
|
20064
20220
|
}
|
|
20065
20221
|
}
|
|
@@ -20079,11 +20235,11 @@ class TriangleRightSymbol extends BaseSymbol {
|
|
|
20079
20235
|
this.pathStr = 'M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z';
|
|
20080
20236
|
}
|
|
20081
20237
|
draw(ctx, size, x, y) {
|
|
20082
|
-
const r = size / 2;
|
|
20238
|
+
const r = this.parseSize(size) / 2;
|
|
20083
20239
|
return trianglRightOffset(ctx, r, x, y);
|
|
20084
20240
|
}
|
|
20085
20241
|
drawOffset(ctx, size, x, y, offset) {
|
|
20086
|
-
const r = size / 2;
|
|
20242
|
+
const r = this.parseSize(size) / 2;
|
|
20087
20243
|
return trianglRightOffset(ctx, r, x, y, offset);
|
|
20088
20244
|
}
|
|
20089
20245
|
}
|
|
@@ -20103,11 +20259,11 @@ class TriangleDownSymbol extends BaseSymbol {
|
|
|
20103
20259
|
this.pathStr = 'M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z';
|
|
20104
20260
|
}
|
|
20105
20261
|
draw(ctx, size, x, y) {
|
|
20106
|
-
const r = size / 2;
|
|
20262
|
+
const r = this.parseSize(size) / 2;
|
|
20107
20263
|
return trianglDownOffset(ctx, r, x, y);
|
|
20108
20264
|
}
|
|
20109
20265
|
drawOffset(ctx, size, x, y, offset) {
|
|
20110
|
-
const r = size / 2;
|
|
20266
|
+
const r = this.parseSize(size) / 2;
|
|
20111
20267
|
return trianglDownOffset(ctx, r, x, y, offset);
|
|
20112
20268
|
}
|
|
20113
20269
|
}
|
|
@@ -20129,11 +20285,11 @@ class ThinTriangleSymbol extends BaseSymbol {
|
|
|
20129
20285
|
this.pathStr = 'M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z';
|
|
20130
20286
|
}
|
|
20131
20287
|
draw(ctx, size, x, y) {
|
|
20132
|
-
const r = size / 2 / sqrt3;
|
|
20288
|
+
const r = this.parseSize(size) / 2 / sqrt3;
|
|
20133
20289
|
return thinTriangle(ctx, r, x, y);
|
|
20134
20290
|
}
|
|
20135
20291
|
drawOffset(ctx, size, x, y, offset) {
|
|
20136
|
-
const r = size / 2 / sqrt3 + offset;
|
|
20292
|
+
const r = this.parseSize(size) / 2 / sqrt3 + offset;
|
|
20137
20293
|
return thinTriangle(ctx, r, x, y);
|
|
20138
20294
|
}
|
|
20139
20295
|
}
|
|
@@ -20153,11 +20309,11 @@ class Arrow2LeftSymbol extends BaseSymbol {
|
|
|
20153
20309
|
this.pathStr = 'M 0.25 -0.5 L -0.25 0 l 0.25 0.5';
|
|
20154
20310
|
}
|
|
20155
20311
|
draw(ctx, size, transX, transY) {
|
|
20156
|
-
const r = size / 4;
|
|
20312
|
+
const r = this.parseSize(size) / 4;
|
|
20157
20313
|
return arrow2Left(ctx, r, transX, transY);
|
|
20158
20314
|
}
|
|
20159
20315
|
drawOffset(ctx, size, transX, transY, offset) {
|
|
20160
|
-
const r = size / 4 + offset;
|
|
20316
|
+
const r = this.parseSize(size) / 4 + offset;
|
|
20161
20317
|
return arrow2Left(ctx, r, transX, transY);
|
|
20162
20318
|
}
|
|
20163
20319
|
}
|
|
@@ -20177,11 +20333,11 @@ class Arrow2RightSymbol extends BaseSymbol {
|
|
|
20177
20333
|
this.pathStr = 'M -0.25 -0.5 l 0.25 0 l -0.25 0.5';
|
|
20178
20334
|
}
|
|
20179
20335
|
draw(ctx, size, transX, transY) {
|
|
20180
|
-
const r = size / 4;
|
|
20336
|
+
const r = this.parseSize(size) / 4;
|
|
20181
20337
|
return arrow2Right(ctx, r, transX, transY);
|
|
20182
20338
|
}
|
|
20183
20339
|
drawOffset(ctx, size, transX, transY, offset) {
|
|
20184
|
-
const r = size / 4 + offset;
|
|
20340
|
+
const r = this.parseSize(size) / 4 + offset;
|
|
20185
20341
|
return arrow2Right(ctx, r, transX, transY);
|
|
20186
20342
|
}
|
|
20187
20343
|
}
|
|
@@ -20201,11 +20357,11 @@ class Arrow2UpSymbol extends BaseSymbol {
|
|
|
20201
20357
|
this.pathStr = 'M -0.5 0.25 L 0 -0.25 l 0.5 0.25';
|
|
20202
20358
|
}
|
|
20203
20359
|
draw(ctx, size, transX, transY) {
|
|
20204
|
-
const r = size / 4;
|
|
20360
|
+
const r = this.parseSize(size) / 4;
|
|
20205
20361
|
return arrow2Up(ctx, r, transX, transY);
|
|
20206
20362
|
}
|
|
20207
20363
|
drawOffset(ctx, size, transX, transY, offset) {
|
|
20208
|
-
const r = size / 4 + offset;
|
|
20364
|
+
const r = this.parseSize(size) / 4 + offset;
|
|
20209
20365
|
return arrow2Up(ctx, r, transX, transY);
|
|
20210
20366
|
}
|
|
20211
20367
|
}
|
|
@@ -20225,11 +20381,11 @@ class Arrow2DownSymbol extends BaseSymbol {
|
|
|
20225
20381
|
this.pathStr = 'M -0.5 -0.25 L 0 0.25 l 0.5 -0.25';
|
|
20226
20382
|
}
|
|
20227
20383
|
draw(ctx, size, transX, transY) {
|
|
20228
|
-
const r = size / 4;
|
|
20384
|
+
const r = this.parseSize(size) / 4;
|
|
20229
20385
|
return arrow2Down(ctx, r, transX, transY);
|
|
20230
20386
|
}
|
|
20231
20387
|
drawOffset(ctx, size, transX, transY, offset) {
|
|
20232
|
-
const r = size / 4 + offset;
|
|
20388
|
+
const r = this.parseSize(size) / 4 + offset;
|
|
20233
20389
|
return arrow2Down(ctx, r, transX, transY);
|
|
20234
20390
|
}
|
|
20235
20391
|
}
|
|
@@ -20247,15 +20403,15 @@ class LineVSymbol extends BaseSymbol {
|
|
|
20247
20403
|
this.pathStr = 'M0,-0.5L0,0.5';
|
|
20248
20404
|
}
|
|
20249
20405
|
draw(ctx, size, x, y, z) {
|
|
20250
|
-
const r = size / 2;
|
|
20406
|
+
const r = this.parseSize(size) / 2;
|
|
20251
20407
|
return lineV(ctx, r, x, y);
|
|
20252
20408
|
}
|
|
20253
20409
|
drawOffset(ctx, size, x, y, offset, z) {
|
|
20254
|
-
const r = size / 2 + offset;
|
|
20410
|
+
const r = this.parseSize(size) / 2 + offset;
|
|
20255
20411
|
return lineV(ctx, r, x, y);
|
|
20256
20412
|
}
|
|
20257
20413
|
drawToSvgPath(size, x, y, z) {
|
|
20258
|
-
const r = size / 2;
|
|
20414
|
+
const r = this.parseSize(size) / 2;
|
|
20259
20415
|
return `M ${x}, ${y - r} L ${x},${y + r}`;
|
|
20260
20416
|
}
|
|
20261
20417
|
}
|
|
@@ -20273,15 +20429,15 @@ class LineHSymbol extends BaseSymbol {
|
|
|
20273
20429
|
this.pathStr = 'M-0.5,0L0.5,0';
|
|
20274
20430
|
}
|
|
20275
20431
|
draw(ctx, size, x, y, z) {
|
|
20276
|
-
const r = size / 2;
|
|
20432
|
+
const r = this.parseSize(size) / 2;
|
|
20277
20433
|
return lineH(ctx, r, x, y);
|
|
20278
20434
|
}
|
|
20279
20435
|
drawOffset(ctx, size, x, y, offset, z) {
|
|
20280
|
-
const r = size / 2 + offset;
|
|
20436
|
+
const r = this.parseSize(size) / 2 + offset;
|
|
20281
20437
|
return lineH(ctx, r, x, y);
|
|
20282
20438
|
}
|
|
20283
20439
|
drawToSvgPath(size, x, y, z) {
|
|
20284
|
-
const r = size / 2;
|
|
20440
|
+
const r = this.parseSize(size) / 2;
|
|
20285
20441
|
return `M ${x - r}, ${y} L ${x + r},${y}`;
|
|
20286
20442
|
}
|
|
20287
20443
|
}
|
|
@@ -20301,15 +20457,15 @@ class CloseSymbol extends BaseSymbol {
|
|
|
20301
20457
|
this.pathStr = 'M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5';
|
|
20302
20458
|
}
|
|
20303
20459
|
draw(ctx, size, x, y, z) {
|
|
20304
|
-
const r = size / 2;
|
|
20460
|
+
const r = this.parseSize(size) / 2;
|
|
20305
20461
|
return close(ctx, r, x, y);
|
|
20306
20462
|
}
|
|
20307
20463
|
drawOffset(ctx, size, x, y, offset, z) {
|
|
20308
|
-
const r = size / 2 + offset;
|
|
20464
|
+
const r = this.parseSize(size) / 2 + offset;
|
|
20309
20465
|
return close(ctx, r, x, y);
|
|
20310
20466
|
}
|
|
20311
20467
|
drawToSvgPath(size, x, y, z) {
|
|
20312
|
-
const r = size / 2;
|
|
20468
|
+
const r = this.parseSize(size) / 2;
|
|
20313
20469
|
return `M ${x - r}, ${y - r} L ${x + r},${y + r} M ${x + r}, ${y - r} L ${x - r},${y + r}`;
|
|
20314
20470
|
}
|
|
20315
20471
|
}
|
|
@@ -20360,6 +20516,7 @@ class CustomSymbolClass {
|
|
|
20360
20516
|
this.isSvg = isSvg;
|
|
20361
20517
|
}
|
|
20362
20518
|
drawOffset(ctx, size, x, y, offset, z, cb) {
|
|
20519
|
+
size = this.parseSize(size);
|
|
20363
20520
|
if (this.isSvg) {
|
|
20364
20521
|
if (!this.svgCache) {
|
|
20365
20522
|
return false;
|
|
@@ -20375,9 +20532,14 @@ class CustomSymbolClass {
|
|
|
20375
20532
|
return false;
|
|
20376
20533
|
}
|
|
20377
20534
|
draw(ctx, size, x, y, z, cb) {
|
|
20535
|
+
size = this.parseSize(size);
|
|
20378
20536
|
return this.drawOffset(ctx, size, x, y, 0, z, cb);
|
|
20379
20537
|
}
|
|
20538
|
+
parseSize(size) {
|
|
20539
|
+
return isNumber(size) ? size : Math.min(size[0], size[1]);
|
|
20540
|
+
}
|
|
20380
20541
|
bounds(size, bounds) {
|
|
20542
|
+
size = this.parseSize(size);
|
|
20381
20543
|
if (this.isSvg) {
|
|
20382
20544
|
if (!this.svgCache) {
|
|
20383
20545
|
return;
|
|
@@ -21397,7 +21559,8 @@ class Paragraph {
|
|
|
21397
21559
|
left = 0;
|
|
21398
21560
|
baseline = 0;
|
|
21399
21561
|
}
|
|
21400
|
-
|
|
21562
|
+
const { lineWidth = 1 } = this.character;
|
|
21563
|
+
if (this.character.stroke && lineWidth) {
|
|
21401
21564
|
applyStrokeStyle(ctx, this.character);
|
|
21402
21565
|
ctx.strokeText(text, left, baseline);
|
|
21403
21566
|
}
|
|
@@ -24219,6 +24382,63 @@ class AutoRenderPlugin {
|
|
|
24219
24382
|
}
|
|
24220
24383
|
}
|
|
24221
24384
|
|
|
24385
|
+
class AutoRefreshPlugin {
|
|
24386
|
+
constructor() {
|
|
24387
|
+
this.name = 'AutoRefreshPlugin';
|
|
24388
|
+
this.activeEvent = 'onRegister';
|
|
24389
|
+
this._uid = Generator.GenAutoIncrementId();
|
|
24390
|
+
this.key = this.name + this._uid;
|
|
24391
|
+
this.handleChange = (graphic) => {
|
|
24392
|
+
if (graphic.glyphHost) {
|
|
24393
|
+
graphic = graphic.glyphHost;
|
|
24394
|
+
}
|
|
24395
|
+
if (graphic.stage === this.pluginService.stage && graphic.stage != null) {
|
|
24396
|
+
graphic.stage.renderNextFrame();
|
|
24397
|
+
}
|
|
24398
|
+
};
|
|
24399
|
+
}
|
|
24400
|
+
activate(context) {
|
|
24401
|
+
this.pluginService = context;
|
|
24402
|
+
this.dpr = application.global.devicePixelRatio;
|
|
24403
|
+
this.refresh();
|
|
24404
|
+
}
|
|
24405
|
+
refresh() {
|
|
24406
|
+
if (!this._refreshByMediaQuery()) {
|
|
24407
|
+
this._refreshByRaf();
|
|
24408
|
+
}
|
|
24409
|
+
}
|
|
24410
|
+
_refreshByRaf() {
|
|
24411
|
+
const raf = application.global.getRequestAnimationFrame();
|
|
24412
|
+
this.rafId = raf(() => {
|
|
24413
|
+
if (application.global.devicePixelRatio !== this.dpr) {
|
|
24414
|
+
this.dpr = application.global.devicePixelRatio;
|
|
24415
|
+
this.pluginService.stage.setDpr(this.dpr, true);
|
|
24416
|
+
}
|
|
24417
|
+
this.refresh();
|
|
24418
|
+
});
|
|
24419
|
+
}
|
|
24420
|
+
_refreshByMediaQuery() {
|
|
24421
|
+
try {
|
|
24422
|
+
const mqString = `(resolution: ${window.devicePixelRatio}dppx)`;
|
|
24423
|
+
const updatePixelRatio = () => {
|
|
24424
|
+
if (window.devicePixelRatio !== this.dpr) {
|
|
24425
|
+
this.dpr = window.devicePixelRatio;
|
|
24426
|
+
this.pluginService.stage.setDpr(this.dpr, true);
|
|
24427
|
+
}
|
|
24428
|
+
};
|
|
24429
|
+
matchMedia(mqString).addEventListener('change', updatePixelRatio);
|
|
24430
|
+
}
|
|
24431
|
+
catch (err) {
|
|
24432
|
+
return false;
|
|
24433
|
+
}
|
|
24434
|
+
return true;
|
|
24435
|
+
}
|
|
24436
|
+
deactivate(context) {
|
|
24437
|
+
const craf = application.global.getCancelAnimationFrame();
|
|
24438
|
+
craf && this.rafId && craf(this.rafId);
|
|
24439
|
+
}
|
|
24440
|
+
}
|
|
24441
|
+
|
|
24222
24442
|
class IncrementalAutoRenderPlugin {
|
|
24223
24443
|
constructor() {
|
|
24224
24444
|
this.name = 'IncrementalAutoRenderPlugin';
|
|
@@ -24497,6 +24717,7 @@ class Stage extends Group {
|
|
|
24497
24717
|
constructor(params = {}) {
|
|
24498
24718
|
var _a;
|
|
24499
24719
|
super({});
|
|
24720
|
+
this.tickedBeforeRender = true;
|
|
24500
24721
|
this._onVisibleChange = (visible) => {
|
|
24501
24722
|
if (this._skipRender < 0) {
|
|
24502
24723
|
return;
|
|
@@ -24523,6 +24744,15 @@ class Stage extends Group {
|
|
|
24523
24744
|
this._afterRender && this._afterRender(stage);
|
|
24524
24745
|
this._afterNextRenderCbs && this._afterNextRenderCbs.forEach(cb => cb(stage));
|
|
24525
24746
|
this._afterNextRenderCbs = null;
|
|
24747
|
+
this.tickedBeforeRender = false;
|
|
24748
|
+
};
|
|
24749
|
+
this.afterTickCb = () => {
|
|
24750
|
+
var _a;
|
|
24751
|
+
this.tickedBeforeRender = true;
|
|
24752
|
+
if (((_a = this.params.optimize) === null || _a === void 0 ? void 0 : _a.tickRenderMode) === 'performance') ;
|
|
24753
|
+
else {
|
|
24754
|
+
this.state !== 'rendering' && this.render();
|
|
24755
|
+
}
|
|
24526
24756
|
};
|
|
24527
24757
|
this.params = params;
|
|
24528
24758
|
this.theme = new Theme();
|
|
@@ -24561,6 +24791,9 @@ class Stage extends Group {
|
|
|
24561
24791
|
if (params.autoRender) {
|
|
24562
24792
|
this.enableAutoRender();
|
|
24563
24793
|
}
|
|
24794
|
+
if (params.autoRefresh) {
|
|
24795
|
+
this.enableAutoRefresh();
|
|
24796
|
+
}
|
|
24564
24797
|
if (params.disableDirtyBounds === false) {
|
|
24565
24798
|
this.enableDirtyBounds();
|
|
24566
24799
|
}
|
|
@@ -24587,6 +24820,7 @@ class Stage extends Group {
|
|
|
24587
24820
|
if (params.background && isString(this._background) && this._background.includes('/')) {
|
|
24588
24821
|
this.setAttributes({ background: this._background });
|
|
24589
24822
|
}
|
|
24823
|
+
this.ticker.on('afterTick', this.afterTickCb);
|
|
24590
24824
|
}
|
|
24591
24825
|
pauseRender(sr = -1) {
|
|
24592
24826
|
this._skipRender = sr;
|
|
@@ -24732,6 +24966,22 @@ class Stage extends Group {
|
|
|
24732
24966
|
this.pluginService.unRegister(plugin);
|
|
24733
24967
|
});
|
|
24734
24968
|
}
|
|
24969
|
+
enableAutoRefresh() {
|
|
24970
|
+
if (this.autoRefresh) {
|
|
24971
|
+
return;
|
|
24972
|
+
}
|
|
24973
|
+
this.autoRefresh = true;
|
|
24974
|
+
this.pluginService.register(new AutoRefreshPlugin());
|
|
24975
|
+
}
|
|
24976
|
+
disableAutoRefresh() {
|
|
24977
|
+
if (!this.autoRefresh) {
|
|
24978
|
+
return;
|
|
24979
|
+
}
|
|
24980
|
+
this.autoRefresh = false;
|
|
24981
|
+
this.pluginService.findPluginsByName('AutoRefreshPlugin').forEach(plugin => {
|
|
24982
|
+
this.pluginService.unRegister(plugin);
|
|
24983
|
+
});
|
|
24984
|
+
}
|
|
24735
24985
|
enableIncrementalAutoRender() {
|
|
24736
24986
|
if (this.increaseAutoRender) {
|
|
24737
24987
|
return;
|
|
@@ -24884,6 +25134,9 @@ class Stage extends Group {
|
|
|
24884
25134
|
this.timeline.resume();
|
|
24885
25135
|
const state = this.state;
|
|
24886
25136
|
this.state = 'rendering';
|
|
25137
|
+
if (!this.tickedBeforeRender) {
|
|
25138
|
+
this.ticker.trySyncTickStatus();
|
|
25139
|
+
}
|
|
24887
25140
|
this.layerService.prepareStageLayer(this);
|
|
24888
25141
|
if (!this._skipRender) {
|
|
24889
25142
|
this.lastRenderparams = params;
|
|
@@ -25081,6 +25334,7 @@ class Stage extends Group {
|
|
|
25081
25334
|
}
|
|
25082
25335
|
this.window.release();
|
|
25083
25336
|
this.ticker.remTimeline(this.timeline);
|
|
25337
|
+
this.ticker.removeListener('afterTick', this.afterTickCb);
|
|
25084
25338
|
this.renderService.renderTreeRoots = [];
|
|
25085
25339
|
}
|
|
25086
25340
|
setStage(stage) {
|
|
@@ -25193,25 +25447,6 @@ function createStage(params) {
|
|
|
25193
25447
|
return new Stage(params);
|
|
25194
25448
|
}
|
|
25195
25449
|
|
|
25196
|
-
var params;
|
|
25197
|
-
(function (params) {
|
|
25198
|
-
params[params["W"] = 1] = "W";
|
|
25199
|
-
params[params["H"] = 2] = "H";
|
|
25200
|
-
params[params["WH"] = 3] = "WH";
|
|
25201
|
-
})(params || (params = {}));
|
|
25202
|
-
|
|
25203
|
-
const strCommandMap = [
|
|
25204
|
-
'arc',
|
|
25205
|
-
'arcTo',
|
|
25206
|
-
'bezierCurveTo',
|
|
25207
|
-
'closePath',
|
|
25208
|
-
'ellipse',
|
|
25209
|
-
'lineTo',
|
|
25210
|
-
'moveTo',
|
|
25211
|
-
'quadraticCurveTo',
|
|
25212
|
-
'rect'
|
|
25213
|
-
];
|
|
25214
|
-
|
|
25215
25450
|
const initMatrix = new Matrix(1, 0, 0, 1, 0, 0);
|
|
25216
25451
|
const globalPoint = { x: 0, y: 0 };
|
|
25217
25452
|
let EmptyContext2d = class EmptyContext2d {
|
|
@@ -26143,56 +26378,12 @@ function simplifyRadialDist(points, sqTolerance) {
|
|
|
26143
26378
|
}
|
|
26144
26379
|
return newPoints;
|
|
26145
26380
|
}
|
|
26146
|
-
function simplifyDPStep(points, startIdx, endIdx, sqTolerance, simplified) {
|
|
26147
|
-
let maxSqDist = sqTolerance;
|
|
26148
|
-
let nextIdx = startIdx;
|
|
26149
|
-
const startX = points[startIdx].x;
|
|
26150
|
-
const startY = points[startIdx].y;
|
|
26151
|
-
const endX = points[endIdx].x;
|
|
26152
|
-
const endY = points[endIdx].y;
|
|
26153
|
-
const vecX2 = endX - startX;
|
|
26154
|
-
const vecY2 = endY - startY;
|
|
26155
|
-
const sqLength = vecX2 * vecX2 + vecY2 * vecY2;
|
|
26156
|
-
let area;
|
|
26157
|
-
let sqArea;
|
|
26158
|
-
let sqDistance;
|
|
26159
|
-
let vecX1;
|
|
26160
|
-
let vecY1;
|
|
26161
|
-
for (let i = startIdx + 1, len = endIdx - 1; i < len; i++) {
|
|
26162
|
-
vecX1 = points[i].x - startX;
|
|
26163
|
-
vecY1 = points[i].y - startY;
|
|
26164
|
-
area = vecX1 * vecY2 - vecX2 * vecY1;
|
|
26165
|
-
sqArea = area * area;
|
|
26166
|
-
sqDistance = sqArea / sqLength;
|
|
26167
|
-
if (sqDistance > maxSqDist) {
|
|
26168
|
-
maxSqDist = sqDistance;
|
|
26169
|
-
nextIdx = i;
|
|
26170
|
-
}
|
|
26171
|
-
}
|
|
26172
|
-
if (maxSqDist > sqTolerance) {
|
|
26173
|
-
if (nextIdx - startIdx > 2) {
|
|
26174
|
-
simplifyDPStep(points, startIdx, nextIdx, sqTolerance, simplified);
|
|
26175
|
-
}
|
|
26176
|
-
simplified.push(points[nextIdx], points[nextIdx + 1]);
|
|
26177
|
-
if (endIdx - nextIdx > 2) {
|
|
26178
|
-
simplifyDPStep(points, nextIdx, endIdx, sqTolerance, simplified);
|
|
26179
|
-
}
|
|
26180
|
-
}
|
|
26181
|
-
}
|
|
26182
|
-
function simplifyDouglasPeucker(points, sqTolerance) {
|
|
26183
|
-
const lastIdx = points.length - 1;
|
|
26184
|
-
const simplified = [points[0]];
|
|
26185
|
-
simplifyDPStep(points, 0, lastIdx, sqTolerance, simplified);
|
|
26186
|
-
simplified.push(points[lastIdx]);
|
|
26187
|
-
return simplified;
|
|
26188
|
-
}
|
|
26189
26381
|
function flatten_simplify(points, tolerance, highestQuality) {
|
|
26190
26382
|
if (points.length <= 10) {
|
|
26191
26383
|
return points;
|
|
26192
26384
|
}
|
|
26193
26385
|
const sqTolerance = tolerance !== undefined ? tolerance * tolerance : 1;
|
|
26194
26386
|
points = highestQuality ? points : simplifyRadialDist(points, sqTolerance);
|
|
26195
|
-
points = simplifyDouglasPeucker(points, sqTolerance);
|
|
26196
26387
|
return points;
|
|
26197
26388
|
}
|
|
26198
26389
|
|
|
@@ -28527,4 +28718,4 @@ const registerFlexLayoutPlugin = () => {
|
|
|
28527
28718
|
Factory.registerPlugin('FlexLayoutPlugin', FlexLayoutPlugin);
|
|
28528
28719
|
};
|
|
28529
28720
|
|
|
28530
|
-
export { ACustomAnimate, ARC3D_NUMBER_TYPE, ARC_NUMBER_TYPE, AREA_NUMBER_TYPE, AbstractGraphicRender, Animate, AnimateGroup, AnimateGroup1, AnimateMode, AnimateStatus, AnimateStepType, Application, Arc, Arc3d, Arc3dRender, ArcRender, ArcRenderContribution, Area, AreaRender, AreaRenderContribution, AttributeAnimate, AttributeUpdateType, AutoEnablePlugins, BaseCanvas, BaseEnvContribution, BaseRender, BaseRenderContributionTime, BaseWindowHandlerContribution, Basis, BeforeRenderConstribution, BoundsContext, BoundsPicker, CIRCLE_NUMBER_TYPE, Canvas3DDrawItemInterceptor, Canvas3DPickItemInterceptor, CanvasFactory, CanvasTextLayout, CbAnimate, Circle, CircleRender, CircleRenderContribution, ClipAngleAnimate, ClipDirectionAnimate, ClipGraphicAnimate, ClipRadiusAnimate, ColorInterpolate, ColorStore, ColorType, CommonDrawItemInterceptorContribution, CommonRenderContribution, Container, ContainerModule, Context2dFactory, ContributionProvider, CurveContext, CurveTypeEnum, CustomEvent, CustomPath2D, CustomSymbolClass, DebugDrawItemInterceptorContribution, DefaultArcAllocate, DefaultArcAttribute, DefaultArcRenderContribution, DefaultAreaAllocate, DefaultAreaAttribute, DefaultAreaTextureRenderContribution, DefaultAttribute, DefaultBaseBackgroundRenderContribution, DefaultBaseInteractiveRenderContribution, DefaultBaseTextureRenderContribution, DefaultCanvasAllocate, DefaultCanvasArcRender, DefaultCanvasAreaRender, DefaultCanvasCircleRender, DefaultCanvasGroupRender, DefaultCanvasImageRender, DefaultCanvasLineRender, DefaultCanvasPathRender, DefaultCanvasPolygonRender, DefaultCanvasRectRender, DefaultCanvasSymbolRender, DefaultCanvasTextRender, DefaultCircleAllocate, DefaultCircleAttribute, DefaultCircleRenderContribution, DefaultConnectAttribute, DefaultDebugAttribute, DefaultFillStyle, DefaultGlobal, DefaultGlobalPickerService, DefaultGlyphAttribute, DefaultGraphicAllocate, DefaultGraphicMemoryManager, DefaultGraphicService, DefaultGraphicUtil, DefaultGroupAttribute, DefaultGroupBackgroundRenderContribution, DefaultImageAttribute, DefaultImageBackgroundRenderContribution, DefaultImageRenderContribution, DefaultLayerService, DefaultLayout, DefaultLineAllocate, DefaultLineAttribute, DefaultMat4Allocate, DefaultMatrixAllocate, DefaultMorphingAnimateConfig, DefaultPathAllocate, DefaultPathAttribute, DefaultPickService, DefaultPickStyle, DefaultPolygonAttribute, DefaultRect3dAttribute, DefaultRectAllocate, DefaultRectAttribute, DefaultRectRenderContribution, DefaultRenderService, DefaultRichTextAttribute, DefaultRichTextIconAttribute, DefaultStateAnimateConfig, DefaultStrokeStyle, DefaultStyle, DefaultSymbolAllocate, DefaultSymbolAttribute, DefaultSymbolRenderContribution, DefaultTextAllocate, DefaultTextAttribute, DefaultTextMeasureContribution, DefaultTextStyle, DefaultTicker, DefaultTimeline, DefaultTransform, DefaultTransformUtil, DefaultWindow, Direction$1 as Direction, DirectionalLight, DrawContribution, DrawItemInterceptor, DynamicLayerHandlerContribution, Edge, EmptyContext2d, EnvContribution, EventManager, EventSystem, EventTarget, FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND, Factory, FadeInPlus, FederatedEvent, FederatedMouseEvent, FederatedPointerEvent, FederatedWheelEvent, FlexLayoutPlugin, GLYPH_NUMBER_TYPE, GRAPHIC_UPDATE_TAG_KEY, GROUP_NUMBER_TYPE, Generator, GlobalPickerService, Glyph, GlyphRender, Graphic, GraphicAnimate, GraphicCreator$1 as GraphicCreator, GraphicPicker, GraphicRender, GraphicService, GraphicUtil, Group, GroupFadeIn, GroupFadeOut, GroupRender, GroupRenderContribution, GroupUpdateAABBBoundsMode, HtmlAttributePlugin, IContainPointMode, IMAGE_NUMBER_TYPE, Image, ImageRender, ImageRenderContribution, IncreaseCount, IncrementalDrawContribution, InputText, InteractiveDrawItemInterceptorContribution, InteractivePickItemInterceptorContribution, InteractiveSubRenderContribution, LINE_NUMBER_TYPE, Layer, LayerService, Line$1 as Line, LineRender, Linear, LinearClosed, ManualTickHandler, ManualTicker, Mat4Allocate, MatrixAllocate, Meteor, MonotoneX, MonotoneY, MorphingPath, MotionPath, MultiToOneMorphingPath, NOWORK_ANIMATE_ATTR, Node, OrthoCamera, PATH_NUMBER_TYPE, POLYGON_NUMBER_TYPE, PURE_STYLE_KEY, PYRAMID3D_NUMBER_TYPE, Path, PathRender, PathRenderContribution, PickItemInterceptor, PickerService, PluginService, Polygon, PolygonRender, PolygonRenderContribution, Pyramid3d, Pyramid3dRender, RAFTickHandler, RECT3D_NUMBER_TYPE, RECT_NUMBER_TYPE, RICHTEXT_NUMBER_TYPE, RafBasedSTO, ReactAttributePlugin, Rect, Rect3DRender, Rect3d, RectRender, RectRenderContribution, ReflectSegContext, RenderSelector, RenderService, ResourceLoader, RichText, RichTextEditPlugin, RichTextRender, RotateBySphereAnimate, SVG_ATTRIBUTE_MAP, SVG_ATTRIBUTE_MAP_KEYS, SVG_PARSE_ATTRIBUTE_MAP, SVG_PARSE_ATTRIBUTE_MAP_KEYS, SYMBOL_NUMBER_TYPE, SegContext, ShadowRoot, ShadowRootDrawItemInterceptorContribution, ShadowRootPickItemInterceptorContribution, SplitRectAfterRenderContribution, SplitRectBeforeRenderContribution, Stage, StaticLayerHandlerContribution, Step$1 as Step, StreamLight, SubAnimate, Symbol$1 as Symbol, SymbolRender, SymbolRenderContribution, TEXT_NUMBER_TYPE, TagPointsUpdate, Text, TextDirection, TextMeasureContribution, TextRender, TextRenderContribution, Theme, TimeOutTickHandler, TransformUtil, UpdateTag, VGlobal, VWindow, ViewTransform3dPlugin, VirtualLayerHandlerContribution, WILDCARD, WindowHandlerContribution, WrapText, XMLParser, _interpolateColor, addArcToBezierPath, addAttributeToPrototype, alignBezierCurves, alignSubpath, application, applyTransformOnBezierCurves, arc3dModule, arcModule, areaModule, bezier, bezierCurversToPath, binarySplitPolygon, bindContributionProvider, bindContributionProviderNoSingletonScope, boundStroke, builtInSymbolStrMap, builtinSymbols, builtinSymbolsMap, calcLineCache, calculateArcCornerRadius, calculateLineHeight, canvasAllocate, centroidOfSubpath, circleBounds, circleModule, clock, cloneGraphic, colorEqual, colorStringInterpolationToStr, container, cornerTangents, createArc, createArc3d, createArea, createCircle, createColor, createConicalGradient, createGlyph, createGroup, createImage, createLine, createMat4, createPath, createPolygon, createPyramid3d, createRect, createRect3d, createRectPath, createRichText, createShadowRoot, createStage, createSymbol, createText, createWrapText, cubicCalc, cubicLength, cubicPointAt, cubicSubdivide, defaultArcAllocate, defaultArcBackgroundRenderContribution, defaultArcRenderContribution, defaultArcTextureRenderContribution, defaultAreaAllocate, defaultBaseBackgroundRenderContribution, defaultBaseTextureRenderContribution, defaultCircleAllocate, defaultCircleBackgroundRenderContribution, defaultCircleRenderContribution, defaultCircleTextureRenderContribution, defaultGraphicMemoryManager, defaultGroupBackgroundRenderContribution, defaultImageBackgroundRenderContribution, defaultImageRenderContribution, defaultLineAllocate, defaultPathAllocate, defaultRectAllocate, defaultRectBackgroundRenderContribution, defaultRectRenderContribution, defaultRectTextureRenderContribution, defaultSymbolAllocate, defaultSymbolBackgroundRenderContribution, defaultSymbolRenderContribution, defaultSymbolTextureRenderContribution, defaultTextAllocate, defaultTicker, defaultTimeline, drawArc, drawArcPath$1 as drawArcPath, drawAreaSegments, drawIncrementalAreaSegments, drawIncrementalSegments, drawPathProxy, drawSegments, enumCommandMap, fillVisible, findBestMorphingRotation, findNextGraphic, flatten_simplify, foreach, foreachAsync, genBasisSegments, genBasisTypeSegments, genLinearClosedSegments, genLinearClosedTypeSegments, genLinearSegments, genLinearTypeSegments, genMonotoneXSegments, genMonotoneXTypeSegments, genMonotoneYSegments, genMonotoneYTypeSegments, genNumberType, genStepSegments, genStepTypeSegments, getAttributeFromDefaultAttrList, getConicGradientAt, getCurrentEnv, getExtraModelMatrix, getModelMatrix, getRichTextBounds, getScaledStroke, getTextBounds, getTheme, getThemeFromGroup, globalTheme, glyphModule, graphicCreator, graphicService, graphicUtil, identityMat4, imageModule, incrementalAddTo, inject, injectable, interpolateColor, interpolateGradientConicalColor, interpolateGradientLinearColor, interpolateGradientRadialColor, interpolatePureColorArray, intersect, isBrowserEnv, isNodeEnv, isSvg, isTransformKey, isXML, layerService, lineModule, lookAt, mat3Tomat4, mat4Allocate, matrixAllocate, morphPath, multiInject, multiToOneMorph, multiplyMat4Mat3, multiplyMat4Mat4, named, newThemeObj, oneToMultiMorph, ortho, parsePadding, parseStroke, parseSvgPath, pathModule, pathToBezierCurves, point$3 as point, pointEqual, pointInterpolation, pointInterpolationHighPerformance, pointsEqual, pointsInterpolation, polygonModule, preLoadAllModule, pyramid3dModule, rafBasedSto, rect3dModule, rectFillVisible, rectModule, rectStrokeVisible, recursiveCallBinarySplit, registerArc3dGraphic, registerArcGraphic, registerAreaGraphic, registerCircleGraphic, registerDirectionalLight, registerFlexLayoutPlugin, registerGlyphGraphic, registerGroupGraphic, registerHtmlAttributePlugin, registerImageGraphic, registerLineGraphic, registerOrthoCamera, registerPathGraphic, registerPolygonGraphic, registerPyramid3dGraphic, registerReactAttributePlugin, registerRect3dGraphic, registerRectGraphic, registerRichtextGraphic, registerShadowRootGraphic, registerSymbolGraphic, registerTextGraphic, registerViewTransform3dPlugin, registerWrapTextGraphic, renderCommandList, rewriteProto, richtextModule, rotateX, rotateY, rotateZ, runFill, runStroke, scaleMat4, segments, shouldUseMat4, snapLength, splitArc, splitArea, splitCircle, splitGraphic, splitLine, splitPath, splitPolygon, splitRect, splitToGrids, strCommandMap, strokeVisible, symbolModule, textAttributesToStyle, textDrawOffsetX, textDrawOffsetY, textLayoutOffsetY, textModule, transformKeys, transformMat4, transformUtil, translate, verticalLayout, vglobal, waitForAllSubLayers, wrapCanvas, wrapContext, xul };
|
|
28721
|
+
export { ACustomAnimate, ARC3D_NUMBER_TYPE, ARC_NUMBER_TYPE, AREA_NUMBER_TYPE, AbstractGraphicRender, Animate, AnimateGroup, AnimateGroup1, AnimateMode, AnimateStatus, AnimateStepType, Application, Arc, Arc3d, Arc3dRender, ArcRender, ArcRenderContribution, Area, AreaRender, AreaRenderContribution, AttributeAnimate, AttributeUpdateType, AutoEnablePlugins, BaseCanvas, BaseEnvContribution, BaseRender, BaseRenderContributionTime, BaseWindowHandlerContribution, Basis, BeforeRenderConstribution, BoundsContext, BoundsPicker, CIRCLE_NUMBER_TYPE, Canvas3DDrawItemInterceptor, Canvas3DPickItemInterceptor, CanvasFactory, CanvasTextLayout, CbAnimate, Circle, CircleRender, CircleRenderContribution, ClipAngleAnimate, ClipDirectionAnimate, ClipGraphicAnimate, ClipRadiusAnimate, ColorInterpolate, ColorStore, ColorType, CommonDrawItemInterceptorContribution, CommonRenderContribution, Container, ContainerModule, Context2dFactory, ContributionProvider, CurveContext, CurveTypeEnum, CustomEvent, CustomPath2D, CustomSymbolClass, DebugDrawItemInterceptorContribution, DefaultArcAllocate, DefaultArcAttribute, DefaultArcRenderContribution, DefaultAreaAllocate, DefaultAreaAttribute, DefaultAreaTextureRenderContribution, DefaultAttribute, DefaultBaseBackgroundRenderContribution, DefaultBaseInteractiveRenderContribution, DefaultBaseTextureRenderContribution, DefaultCanvasAllocate, DefaultCanvasArcRender, DefaultCanvasAreaRender, DefaultCanvasCircleRender, DefaultCanvasGroupRender, DefaultCanvasImageRender, DefaultCanvasLineRender, DefaultCanvasPathRender, DefaultCanvasPolygonRender, DefaultCanvasRectRender, DefaultCanvasSymbolRender, DefaultCanvasTextRender, DefaultCircleAllocate, DefaultCircleAttribute, DefaultCircleRenderContribution, DefaultConnectAttribute, DefaultDebugAttribute, DefaultFillStyle, DefaultGlobal, DefaultGlobalPickerService, DefaultGlyphAttribute, DefaultGraphicAllocate, DefaultGraphicMemoryManager, DefaultGraphicService, DefaultGraphicUtil, DefaultGroupAttribute, DefaultGroupBackgroundRenderContribution, DefaultImageAttribute, DefaultImageBackgroundRenderContribution, DefaultImageRenderContribution, DefaultLayerService, DefaultLayout, DefaultLineAllocate, DefaultLineAttribute, DefaultMat4Allocate, DefaultMatrixAllocate, DefaultMorphingAnimateConfig, DefaultPathAllocate, DefaultPathAttribute, DefaultPickService, DefaultPickStyle, DefaultPolygonAttribute, DefaultRect3dAttribute, DefaultRectAllocate, DefaultRectAttribute, DefaultRectRenderContribution, DefaultRenderService, DefaultRichTextAttribute, DefaultRichTextIconAttribute, DefaultStateAnimateConfig, DefaultStrokeStyle, DefaultStyle, DefaultSymbolAllocate, DefaultSymbolAttribute, DefaultSymbolRenderContribution, DefaultTextAllocate, DefaultTextAttribute, DefaultTextMeasureContribution, DefaultTextStyle, DefaultTicker, DefaultTimeline, DefaultTransform, DefaultTransformUtil, DefaultWindow, Direction$1 as Direction, DirectionalLight, DrawContribution, DrawItemInterceptor, DynamicLayerHandlerContribution, Edge, EmptyContext2d, EnvContribution, EventManager, EventSystem, EventTarget, FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND, Factory, FadeInPlus, FederatedEvent, FederatedMouseEvent, FederatedPointerEvent, FederatedWheelEvent, FlexLayoutPlugin, GLYPH_NUMBER_TYPE, GRAPHIC_UPDATE_TAG_KEY, GROUP_NUMBER_TYPE, Generator, GlobalPickerService, Glyph, GlyphRender, Graphic, GraphicAnimate, GraphicCreator$1 as GraphicCreator, GraphicPicker, GraphicRender, GraphicService, GraphicUtil, Group, GroupFadeIn, GroupFadeOut, GroupRender, GroupRenderContribution, GroupUpdateAABBBoundsMode, HtmlAttributePlugin, IContainPointMode, IMAGE_NUMBER_TYPE, Image, ImageRender, ImageRenderContribution, IncreaseCount, IncrementalDrawContribution, InputText, InteractiveDrawItemInterceptorContribution, InteractivePickItemInterceptorContribution, InteractiveSubRenderContribution, LINE_NUMBER_TYPE, Layer, LayerService, Line$1 as Line, LineRender, Linear, LinearClosed, ManualTickHandler, ManualTicker, Mat4Allocate, MatrixAllocate, MeasureModeEnum, Meteor, MonotoneX, MonotoneY, MorphingPath, MotionPath, MultiToOneMorphingPath, NOWORK_ANIMATE_ATTR, Node, OrthoCamera, PATH_NUMBER_TYPE, POLYGON_NUMBER_TYPE, PURE_STYLE_KEY, PYRAMID3D_NUMBER_TYPE, Path, PathRender, PathRenderContribution, PickItemInterceptor, PickerService, PluginService, Polygon, PolygonRender, PolygonRenderContribution, Pyramid3d, Pyramid3dRender, RAFTickHandler, RECT3D_NUMBER_TYPE, RECT_NUMBER_TYPE, RICHTEXT_NUMBER_TYPE, RafBasedSTO, ReactAttributePlugin, Rect, Rect3DRender, Rect3d, RectRender, RectRenderContribution, ReflectSegContext, RenderSelector, RenderService, ResourceLoader, RichText, RichTextEditPlugin, RichTextRender, RotateBySphereAnimate, SVG_ATTRIBUTE_MAP, SVG_ATTRIBUTE_MAP_KEYS, SVG_PARSE_ATTRIBUTE_MAP, SVG_PARSE_ATTRIBUTE_MAP_KEYS, SYMBOL_NUMBER_TYPE, SegContext, ShadowRoot, ShadowRootDrawItemInterceptorContribution, ShadowRootPickItemInterceptorContribution, SplitRectAfterRenderContribution, SplitRectBeforeRenderContribution, Stage, StaticLayerHandlerContribution, Step$1 as Step, StreamLight, SubAnimate, Symbol$1 as Symbol, SymbolRender, SymbolRenderContribution, TEXT_NUMBER_TYPE, TagPointsUpdate, Text, TextDirection, TextMeasureContribution, TextRender, TextRenderContribution, Theme, TimeOutTickHandler, TransformUtil, UpdateTag, VGlobal, VWindow, ViewTransform3dPlugin, VirtualLayerHandlerContribution, WILDCARD, WindowHandlerContribution, WrapText, XMLParser, _interpolateColor, addArcToBezierPath, addAttributeToPrototype, alignBezierCurves, alignSubpath, application, applyTransformOnBezierCurves, arc3dModule, arcModule, areaModule, bezier, bezierCurversToPath, binarySplitPolygon, bindContributionProvider, bindContributionProviderNoSingletonScope, boundStroke, builtInSymbolStrMap, builtinSymbols, builtinSymbolsMap, calcLineCache, calculateArcCornerRadius, calculateLineHeight, canvasAllocate, centroidOfSubpath, circleBounds, circleModule, clock, cloneGraphic, colorEqual, colorStringInterpolationToStr, container, cornerTangents, createArc, createArc3d, createArea, createCircle, createColor, createConicalGradient, createGlyph, createGroup, createImage, createLine, createMat4, createPath, createPolygon, createPyramid3d, createRect, createRect3d, createRectPath, createRichText, createShadowRoot, createStage, createSymbol, createText, createWrapText, cubicCalc, cubicLength, cubicPointAt, cubicSubdivide, defaultArcAllocate, defaultArcBackgroundRenderContribution, defaultArcRenderContribution, defaultArcTextureRenderContribution, defaultAreaAllocate, defaultBaseBackgroundRenderContribution, defaultBaseTextureRenderContribution, defaultCircleAllocate, defaultCircleBackgroundRenderContribution, defaultCircleRenderContribution, defaultCircleTextureRenderContribution, defaultGraphicMemoryManager, defaultGroupBackgroundRenderContribution, defaultImageBackgroundRenderContribution, defaultImageRenderContribution, defaultLineAllocate, defaultPathAllocate, defaultRectAllocate, defaultRectBackgroundRenderContribution, defaultRectRenderContribution, defaultRectTextureRenderContribution, defaultSymbolAllocate, defaultSymbolBackgroundRenderContribution, defaultSymbolRenderContribution, defaultSymbolTextureRenderContribution, defaultTextAllocate, defaultTicker, defaultTimeline, drawArc, drawArcPath$1 as drawArcPath, drawAreaSegments, drawIncrementalAreaSegments, drawIncrementalSegments, drawPathProxy, drawSegments, enumCommandMap, fillVisible, findBestMorphingRotation, findNextGraphic, flatten_simplify, foreach, foreachAsync, genBasisSegments, genBasisTypeSegments, genLinearClosedSegments, genLinearClosedTypeSegments, genLinearSegments, genLinearTypeSegments, genMonotoneXSegments, genMonotoneXTypeSegments, genMonotoneYSegments, genMonotoneYTypeSegments, genNumberType, genStepSegments, genStepTypeSegments, getAttributeFromDefaultAttrList, getConicGradientAt, getCurrentEnv, getExtraModelMatrix, getModelMatrix, getRichTextBounds, getScaledStroke, getTextBounds, getTheme, getThemeFromGroup, globalTheme, glyphModule, graphicCreator, graphicService, graphicUtil, identityMat4, imageModule, incrementalAddTo, inject, injectable, interpolateColor, interpolateGradientConicalColor, interpolateGradientLinearColor, interpolateGradientRadialColor, interpolatePureColorArray, intersect, isBrowserEnv, isNodeEnv, isSvg, isTransformKey, isXML, layerService, lineModule, lookAt, mat3Tomat4, mat4Allocate, matrixAllocate, morphPath, multiInject, multiToOneMorph, multiplyMat4Mat3, multiplyMat4Mat4, named, newThemeObj, oneToMultiMorph, ortho, parsePadding, parseStroke, parseSvgPath, pathModule, pathToBezierCurves, point$3 as point, pointEqual, pointInterpolation, pointInterpolationHighPerformance, pointsEqual, pointsInterpolation, polygonModule, preLoadAllModule, pyramid3dModule, rafBasedSto, rect3dModule, rectFillVisible, rectModule, rectStrokeVisible, recursiveCallBinarySplit, registerArc3dGraphic, registerArcGraphic, registerAreaGraphic, registerCircleGraphic, registerDirectionalLight, registerFlexLayoutPlugin, registerGlyphGraphic, registerGroupGraphic, registerHtmlAttributePlugin, registerImageGraphic, registerLineGraphic, registerOrthoCamera, registerPathGraphic, registerPolygonGraphic, registerPyramid3dGraphic, registerReactAttributePlugin, registerRect3dGraphic, registerRectGraphic, registerRichtextGraphic, registerShadowRootGraphic, registerSymbolGraphic, registerTextGraphic, registerViewTransform3dPlugin, registerWrapTextGraphic, renderCommandList, rewriteProto, richtextModule, rotateX, rotateY, rotateZ, runFill, runStroke, scaleMat4, segments, shouldUseMat4, snapLength, splitArc, splitArea, splitCircle, splitGraphic, splitLine, splitPath, splitPolygon, splitRect, splitToGrids, strCommandMap, strokeVisible, symbolModule, textAttributesToStyle, textDrawOffsetX, textDrawOffsetY, textLayoutOffsetY, textModule, transformKeys, transformMat4, transformUtil, translate, verticalLayout, vglobal, waitForAllSubLayers, wrapCanvas, wrapContext, xul };
|