@visactor/vrender 0.21.0-alpha.4 → 0.21.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/dist/index.es.js +491 -490
- package/dist/index.js +490 -489
- package/dist/index.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.es.js
CHANGED
|
@@ -742,6 +742,13 @@ let DefaultGlobal = class {
|
|
|
742
742
|
};
|
|
743
743
|
DefaultGlobal = __decorate$1H([injectable(), __param$T(0, inject(ContributionProvider)), __param$T(0, named(EnvContribution)), __metadata$1h("design:paramtypes", [Object])], DefaultGlobal);
|
|
744
744
|
|
|
745
|
+
var MeasureModeEnum;
|
|
746
|
+
!function (MeasureModeEnum) {
|
|
747
|
+
MeasureModeEnum[MeasureModeEnum.estimate = 0] = "estimate", MeasureModeEnum[MeasureModeEnum.actualBounding = 1] = "actualBounding", MeasureModeEnum[MeasureModeEnum.fontBounding = 2] = "fontBounding";
|
|
748
|
+
}(MeasureModeEnum || (MeasureModeEnum = {}));
|
|
749
|
+
|
|
750
|
+
const strCommandMap = ["arc", "arcTo", "bezierCurveTo", "closePath", "ellipse", "lineTo", "moveTo", "quadraticCurveTo", "rect"];
|
|
751
|
+
|
|
745
752
|
function getDefaultExportFromCjs (x) {
|
|
746
753
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
747
754
|
}
|
|
@@ -3913,6 +3920,7 @@ const DefaultStrokeStyle = Object.assign({
|
|
|
3913
3920
|
const DefaultTextStyle = {
|
|
3914
3921
|
text: "",
|
|
3915
3922
|
maxLineWidth: 1 / 0,
|
|
3923
|
+
maxWidth: 1 / 0,
|
|
3916
3924
|
textAlign: "left",
|
|
3917
3925
|
textBaseline: "alphabetic",
|
|
3918
3926
|
fontSize: 16,
|
|
@@ -3936,7 +3944,8 @@ const DefaultTextStyle = {
|
|
|
3936
3944
|
suffixPosition: "end",
|
|
3937
3945
|
underlineDash: [],
|
|
3938
3946
|
underlineOffset: 0,
|
|
3939
|
-
disableAutoClipedPoptip: void 0
|
|
3947
|
+
disableAutoClipedPoptip: void 0,
|
|
3948
|
+
measureMode: MeasureModeEnum.fontBounding
|
|
3940
3949
|
};
|
|
3941
3950
|
const DefaultPickStyle = {
|
|
3942
3951
|
pickStrokeBuffer: 0
|
|
@@ -3990,7 +3999,8 @@ const DefaultAttribute = Object.assign(Object.assign(Object.assign({
|
|
|
3990
3999
|
globalZIndex: 1,
|
|
3991
4000
|
globalCompositeOperation: "",
|
|
3992
4001
|
overflow: "hidden",
|
|
3993
|
-
shadowPickMode: "graphic"
|
|
4002
|
+
shadowPickMode: "graphic",
|
|
4003
|
+
keepStrokeScale: !1
|
|
3994
4004
|
}, DefaultDebugAttribute), DefaultStyle), DefaultTransform);
|
|
3995
4005
|
function addAttributeToPrototype(obj, c, keys) {
|
|
3996
4006
|
keys.forEach(key => {
|
|
@@ -4265,10 +4275,32 @@ let ATextMeasure = class {
|
|
|
4265
4275
|
configure(service, env) {
|
|
4266
4276
|
this.canvas = service.canvas, this.context = service.context, service.bindTextMeasure(this);
|
|
4267
4277
|
}
|
|
4268
|
-
|
|
4269
|
-
if (!this.context) return this.estimate(text, options).width;
|
|
4278
|
+
_measureTextWithoutAlignBaseline(text, options, compatible) {
|
|
4270
4279
|
this.context.setTextStyleWithoutAlignBaseline(options);
|
|
4271
|
-
|
|
4280
|
+
const metrics = this.context.measureText(text);
|
|
4281
|
+
return compatible ? this.compatibleMetrics(metrics, options) : metrics;
|
|
4282
|
+
}
|
|
4283
|
+
_measureTextWithAlignBaseline(text, options, compatible) {
|
|
4284
|
+
this.context.setTextStyle(options);
|
|
4285
|
+
const metrics = this.context.measureText(text);
|
|
4286
|
+
return compatible ? this.compatibleMetrics(metrics, options) : metrics;
|
|
4287
|
+
}
|
|
4288
|
+
compatibleMetrics(metrics, options) {
|
|
4289
|
+
if (null == metrics.actualBoundingBoxAscent || null == metrics.actualBoundingBoxDescent || null == metrics.fontBoundingBoxAscent || null == metrics.fontBoundingBoxDescent) {
|
|
4290
|
+
const {
|
|
4291
|
+
ascent: ascent,
|
|
4292
|
+
descent: descent
|
|
4293
|
+
} = this.measureTextBoundADscentEstimate(options);
|
|
4294
|
+
metrics.actualBoundingBoxAscent = ascent, metrics.actualBoundingBoxDescent = descent, metrics.fontBoundingBoxAscent = ascent, metrics.fontBoundingBoxDescent = descent;
|
|
4295
|
+
}
|
|
4296
|
+
if (null == metrics.actualBoundingBoxLeft || null == metrics.actualBoundingBoxRight) {
|
|
4297
|
+
const {
|
|
4298
|
+
left: left,
|
|
4299
|
+
right: right
|
|
4300
|
+
} = this.measureTextBoundLeftRightEstimate(options);
|
|
4301
|
+
metrics.actualBoundingBoxLeft = left, metrics.actualBoundingBoxRight = right;
|
|
4302
|
+
}
|
|
4303
|
+
return metrics;
|
|
4272
4304
|
}
|
|
4273
4305
|
estimate(text, _ref) {
|
|
4274
4306
|
let {
|
|
@@ -4282,19 +4314,104 @@ let ATextMeasure = class {
|
|
|
4282
4314
|
height: fontSize
|
|
4283
4315
|
};
|
|
4284
4316
|
}
|
|
4285
|
-
|
|
4317
|
+
measureTextWidth(text, options, textMeasure) {
|
|
4318
|
+
return this.context ? (textMeasure = null != textMeasure ? textMeasure : this._measureTextWithoutAlignBaseline(text, options)).width : this.estimate(text, options).width;
|
|
4319
|
+
}
|
|
4320
|
+
measureTextBoundsWidth(text, options, textMeasure) {
|
|
4321
|
+
return this.context ? (textMeasure = null != textMeasure ? textMeasure : this._measureTextWithoutAlignBaseline(text, options)).width : this.estimate(text, options).width;
|
|
4322
|
+
}
|
|
4323
|
+
measureTextBoundsLeftRight(text, options, textMeasure) {
|
|
4324
|
+
return this.context ? {
|
|
4325
|
+
left: (textMeasure = null != textMeasure ? textMeasure : this._measureTextWithAlignBaseline(text, options, !0)).actualBoundingBoxLeft,
|
|
4326
|
+
right: textMeasure.actualBoundingBoxRight
|
|
4327
|
+
} : this.measureTextBoundLeftRightEstimate(options);
|
|
4328
|
+
}
|
|
4329
|
+
measureTextPixelHeight(text, options, textMeasure) {
|
|
4286
4330
|
var _a;
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
return
|
|
4331
|
+
return this.context ? (textMeasure = null != textMeasure ? textMeasure : this._measureTextWithoutAlignBaseline(text, options, !0), Math.abs(textMeasure.actualBoundingBoxAscent - textMeasure.actualBoundingBoxDescent)) : null !== (_a = options.fontSize) && void 0 !== _a ? _a : DefaultTextStyle.fontSize;
|
|
4332
|
+
}
|
|
4333
|
+
measureTextPixelADscent(text, options, textMeasure) {
|
|
4334
|
+
return this.context ? {
|
|
4335
|
+
ascent: (textMeasure = null != textMeasure ? textMeasure : this._measureTextWithAlignBaseline(text, options, !0)).actualBoundingBoxAscent,
|
|
4336
|
+
descent: textMeasure.actualBoundingBoxDescent
|
|
4337
|
+
} : this.measureTextBoundADscentEstimate(options);
|
|
4291
4338
|
}
|
|
4292
|
-
measureTextBoundHieght(text, options) {
|
|
4339
|
+
measureTextBoundHieght(text, options, textMeasure) {
|
|
4293
4340
|
var _a;
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
return
|
|
4341
|
+
return this.context ? (textMeasure = null != textMeasure ? textMeasure : this._measureTextWithoutAlignBaseline(text, options, !0), Math.abs(textMeasure.fontBoundingBoxAscent - textMeasure.fontBoundingBoxDescent)) : null !== (_a = options.fontSize) && void 0 !== _a ? _a : DefaultTextStyle.fontSize;
|
|
4342
|
+
}
|
|
4343
|
+
measureTextBoundADscent(text, options, textMeasure) {
|
|
4344
|
+
return this.context ? {
|
|
4345
|
+
ascent: (textMeasure = null != textMeasure ? textMeasure : this._measureTextWithAlignBaseline(text, options, !0)).fontBoundingBoxAscent,
|
|
4346
|
+
descent: textMeasure.fontBoundingBoxDescent
|
|
4347
|
+
} : this.measureTextBoundADscentEstimate(options);
|
|
4348
|
+
}
|
|
4349
|
+
measureTextBoundADscentEstimate(options) {
|
|
4350
|
+
var _a;
|
|
4351
|
+
const fontSize = null !== (_a = options.fontSize) && void 0 !== _a ? _a : DefaultTextStyle.fontSize;
|
|
4352
|
+
return {
|
|
4353
|
+
ascent: .79 * fontSize,
|
|
4354
|
+
descent: .21 * fontSize
|
|
4355
|
+
};
|
|
4356
|
+
}
|
|
4357
|
+
measureTextBoundLeftRightEstimate(options) {
|
|
4358
|
+
var _a;
|
|
4359
|
+
const fontSize = null !== (_a = options.fontSize) && void 0 !== _a ? _a : DefaultTextStyle.fontSize,
|
|
4360
|
+
{
|
|
4361
|
+
textAlign: textAlign
|
|
4362
|
+
} = options;
|
|
4363
|
+
return "center" === textAlign ? {
|
|
4364
|
+
left: fontSize / 2,
|
|
4365
|
+
right: fontSize / 2
|
|
4366
|
+
} : "right" === textAlign || "end" === textAlign ? {
|
|
4367
|
+
left: fontSize,
|
|
4368
|
+
right: 0
|
|
4369
|
+
} : {
|
|
4370
|
+
left: 0,
|
|
4371
|
+
right: fontSize
|
|
4372
|
+
};
|
|
4373
|
+
}
|
|
4374
|
+
measureTextPixelADscentAndWidth(text, options, mode) {
|
|
4375
|
+
if (!this.context) return Object.assign(Object.assign({}, this.measureTextBoundADscentEstimate(options)), {
|
|
4376
|
+
width: this.estimate(text, options).width
|
|
4377
|
+
});
|
|
4378
|
+
const out = this._measureTextWithoutAlignBaseline(text, options, !0);
|
|
4379
|
+
if (mode === MeasureModeEnum.actualBounding) return {
|
|
4380
|
+
ascent: out.actualBoundingBoxAscent,
|
|
4381
|
+
descent: out.actualBoundingBoxDescent,
|
|
4382
|
+
width: out.width
|
|
4383
|
+
};
|
|
4384
|
+
if (mode === MeasureModeEnum.estimate) return Object.assign(Object.assign({}, this.measureTextBoundADscentEstimate(options)), {
|
|
4385
|
+
width: out.width
|
|
4386
|
+
});
|
|
4387
|
+
if (mode === MeasureModeEnum.fontBounding) {
|
|
4388
|
+
const {
|
|
4389
|
+
lineHeight = options.fontSize
|
|
4390
|
+
} = options;
|
|
4391
|
+
let ratio = 1;
|
|
4392
|
+
if (lineHeight) {
|
|
4393
|
+
ratio = lineHeight / (out.fontBoundingBoxAscent + out.fontBoundingBoxDescent);
|
|
4394
|
+
}
|
|
4395
|
+
let ascent = out.fontBoundingBoxAscent * ratio,
|
|
4396
|
+
descent = out.fontBoundingBoxDescent * ratio;
|
|
4397
|
+
if (out.actualBoundingBoxDescent && descent < out.actualBoundingBoxDescent) {
|
|
4398
|
+
const delta = out.actualBoundingBoxDescent - descent;
|
|
4399
|
+
descent += delta, ascent -= delta;
|
|
4400
|
+
} else if (out.actualBoundingBoxAscent && ascent < out.actualBoundingBoxAscent) {
|
|
4401
|
+
const delta = out.actualBoundingBoxAscent - ascent;
|
|
4402
|
+
ascent += delta, descent -= delta;
|
|
4403
|
+
}
|
|
4404
|
+
return {
|
|
4405
|
+
ascent: ascent,
|
|
4406
|
+
descent: descent,
|
|
4407
|
+
width: out.width
|
|
4408
|
+
};
|
|
4409
|
+
}
|
|
4410
|
+
return {
|
|
4411
|
+
ascent: out.actualBoundingBoxAscent,
|
|
4412
|
+
descent: out.actualBoundingBoxDescent,
|
|
4413
|
+
width: out.width
|
|
4414
|
+
};
|
|
4298
4415
|
}
|
|
4299
4416
|
measureText(text, options) {
|
|
4300
4417
|
return this.context ? (this.context.setTextStyleWithoutAlignBaseline(options), this.context.measureText(text)) : this.estimate(text, options);
|
|
@@ -6406,7 +6523,7 @@ class TimeOutTickHandler {
|
|
|
6406
6523
|
}
|
|
6407
6524
|
}
|
|
6408
6525
|
|
|
6409
|
-
class DefaultTicker {
|
|
6526
|
+
class DefaultTicker extends EventEmitter {
|
|
6410
6527
|
set mode(m) {
|
|
6411
6528
|
this._mode !== m && (this._mode = m, this.setupTickHandler());
|
|
6412
6529
|
}
|
|
@@ -6415,17 +6532,17 @@ class DefaultTicker {
|
|
|
6415
6532
|
}
|
|
6416
6533
|
constructor() {
|
|
6417
6534
|
let timelines = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
6418
|
-
this.handleTick = (handler, params) => {
|
|
6535
|
+
super(), this.handleTick = (handler, params) => {
|
|
6419
6536
|
const {
|
|
6420
6537
|
once = !1
|
|
6421
6538
|
} = null != params ? params : {};
|
|
6422
|
-
this.ifCanStop() ? this.stop() : (this._handlerTick(
|
|
6423
|
-
}, this._handlerTick =
|
|
6539
|
+
this.ifCanStop() ? this.stop() : (this._handlerTick(), once || handler.tick(this.interval, this.handleTick));
|
|
6540
|
+
}, this._handlerTick = () => {
|
|
6424
6541
|
const time = this.tickerHandler.getTime();
|
|
6425
6542
|
let delta = 0;
|
|
6426
6543
|
this.lastFrameTime >= 0 && (delta = time - this.lastFrameTime), this.lastFrameTime = time, this.status === STATUS$1.RUNNING && (this.tickCounts++, this.timelines.forEach(t => {
|
|
6427
6544
|
t.tick(delta);
|
|
6428
|
-
}));
|
|
6545
|
+
}), this.emit("afterTick"));
|
|
6429
6546
|
}, this.init(), this.lastFrameTime = -1, this.tickCounts = 0, this.timelines = timelines, this.autoStop = !0;
|
|
6430
6547
|
}
|
|
6431
6548
|
init() {
|
|
@@ -6521,6 +6638,9 @@ class DefaultTicker {
|
|
|
6521
6638
|
stop() {
|
|
6522
6639
|
this.status = STATUS$1.INITIAL, this.setupTickHandler(), this.lastFrameTime = -1;
|
|
6523
6640
|
}
|
|
6641
|
+
trySyncTickStatus() {
|
|
6642
|
+
this.status === STATUS$1.RUNNING && this._handlerTick();
|
|
6643
|
+
}
|
|
6524
6644
|
}
|
|
6525
6645
|
|
|
6526
6646
|
class ManualTickHandler {
|
|
@@ -7662,7 +7782,7 @@ class TagPointsUpdate extends ACustomAnimate {
|
|
|
7662
7782
|
lastMatchedIndex = i, lastMatchedPoint = tagMap.get(this.toPoints[i].context);
|
|
7663
7783
|
break;
|
|
7664
7784
|
}
|
|
7665
|
-
"clip" === this.newPointAnimateType && 0 !== this.toPoints.length && (Number.isFinite(lastMatchedIndex) ? (this.clipRange = this.toPoints[lastMatchedIndex][this.clipRangeByDimension] / this.toPoints[this.toPoints.length - 1][this.clipRangeByDimension], isValidNumber$1(this.clipRange) ? this.clipRange = clamp$1(this.clipRange, 0, 1) : this.clipRange = 0) : this.clipRange = 0);
|
|
7785
|
+
"clip" === this.newPointAnimateType && 0 !== this.toPoints.length && (Number.isFinite(lastMatchedIndex) ? (this.clipRange = this.toPoints[lastMatchedIndex][this.clipRangeByDimension] / this.toPoints[this.toPoints.length - 1][this.clipRangeByDimension], 1 === this.clipRange && (this.shrinkClipRange = this.toPoints[lastMatchedIndex][this.clipRangeByDimension] / this.fromPoints[this.fromPoints.length - 1][this.clipRangeByDimension]), isValidNumber$1(this.clipRange) ? this.clipRange = clamp$1(this.clipRange, 0, 1) : this.clipRange = 0) : this.clipRange = 0);
|
|
7666
7786
|
let prevMatchedPoint = this.toPoints[0];
|
|
7667
7787
|
this.interpolatePoints = this.toPoints.map((point, index) => {
|
|
7668
7788
|
const matchedPoint = tagMap.get(point.context);
|
|
@@ -7674,11 +7794,19 @@ class TagPointsUpdate extends ACustomAnimate {
|
|
|
7674
7794
|
return newPoint.defined = toPoint.defined, newPoint.context = toPoint.context, newPoint;
|
|
7675
7795
|
});
|
|
7676
7796
|
}
|
|
7797
|
+
onFirstRun() {
|
|
7798
|
+
const lastClipRange = this.target.attribute.clipRange;
|
|
7799
|
+
isValidNumber$1(lastClipRange * this.clipRange) && (this.clipRange *= lastClipRange);
|
|
7800
|
+
}
|
|
7677
7801
|
onUpdate(end, ratio, out) {
|
|
7678
7802
|
if (this.points = this.points.map((point, index) => {
|
|
7679
7803
|
const newPoint = pointInterpolation(this.interpolatePoints[index][0], this.interpolatePoints[index][1], ratio);
|
|
7680
7804
|
return newPoint.context = point.context, newPoint;
|
|
7681
|
-
}), this.clipRange
|
|
7805
|
+
}), this.clipRange) {
|
|
7806
|
+
if (this.shrinkClipRange) return void (end ? (out.points = this.toPoints, out.clipRange = 1) : (out.points = this.fromPoints, out.clipRange = this.clipRange - (this.clipRange - this.shrinkClipRange) * ratio));
|
|
7807
|
+
out.clipRange = this.clipRange + (1 - this.clipRange) * ratio;
|
|
7808
|
+
}
|
|
7809
|
+
if (this.segmentsCache && this.to.segments) {
|
|
7682
7810
|
let start = 0;
|
|
7683
7811
|
out.segments = this.to.segments.map((segment, index) => {
|
|
7684
7812
|
const end = start + this.segmentsCache[index],
|
|
@@ -9094,7 +9222,7 @@ class ResourceLoader {
|
|
|
9094
9222
|
}
|
|
9095
9223
|
static GetFile(url, type) {
|
|
9096
9224
|
let data = ResourceLoader.cache.get(url);
|
|
9097
|
-
return data ? "fail" === data.loadState ? Promise.reject() : "
|
|
9225
|
+
return data ? "init" === data.loadState || "fail" === data.loadState ? Promise.reject() : "loading" === data.loadState ? data.dataPromise.then(data => data.data) : Promise.resolve(data.data) : (data = {
|
|
9098
9226
|
type: type,
|
|
9099
9227
|
loadState: "init"
|
|
9100
9228
|
}, ResourceLoader.cache.set(url, data), "arrayBuffer" === type ? data.dataPromise = application.global.loadArrayBuffer(url) : "blob" === type ? data.dataPromise = application.global.loadBlob(url) : "json" === type && (data.dataPromise = application.global.loadJson(url)), data.dataPromise.then(data => data.data));
|
|
@@ -12032,7 +12160,8 @@ class DefaultArcRenderContribution {
|
|
|
12032
12160
|
x: originX = arcAttribute.x,
|
|
12033
12161
|
y: originY = arcAttribute.y,
|
|
12034
12162
|
scaleX = arcAttribute.scaleX,
|
|
12035
|
-
scaleY = arcAttribute.scaleY
|
|
12163
|
+
scaleY = arcAttribute.scaleY,
|
|
12164
|
+
keepStrokeScale = arcAttribute.keepStrokeScale
|
|
12036
12165
|
} = arc.attribute;
|
|
12037
12166
|
let {
|
|
12038
12167
|
innerRadius = arcAttribute.innerRadius,
|
|
@@ -12044,7 +12173,7 @@ class DefaultArcRenderContribution {
|
|
|
12044
12173
|
{
|
|
12045
12174
|
distance = arcAttribute[key].distance
|
|
12046
12175
|
} = borderStyle,
|
|
12047
|
-
d = getScaledStroke(context, distance, context.dpr),
|
|
12176
|
+
d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr),
|
|
12048
12177
|
deltaAngle = distance / outerRadius,
|
|
12049
12178
|
sign = "outerBorder" === key ? 1 : -1;
|
|
12050
12179
|
if (arc.setAttributes({
|
|
@@ -12089,14 +12218,15 @@ class DefaultCircleRenderContribution {
|
|
|
12089
12218
|
x: originX = circleAttribute.x,
|
|
12090
12219
|
y: originY = circleAttribute.y,
|
|
12091
12220
|
scaleX = circleAttribute.scaleX,
|
|
12092
|
-
scaleY = circleAttribute.scaleY
|
|
12221
|
+
scaleY = circleAttribute.scaleY,
|
|
12222
|
+
keepStrokeScale = circleAttribute.keepStrokeScale
|
|
12093
12223
|
} = circle.attribute,
|
|
12094
12224
|
renderBorder = (borderStyle, key) => {
|
|
12095
12225
|
const doStroke = !(!borderStyle || !borderStyle.stroke),
|
|
12096
12226
|
{
|
|
12097
12227
|
distance = circleAttribute[key].distance
|
|
12098
12228
|
} = borderStyle,
|
|
12099
|
-
d = getScaledStroke(context, distance, context.dpr),
|
|
12229
|
+
d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr),
|
|
12100
12230
|
sign = "outerBorder" === key ? 1 : -1;
|
|
12101
12231
|
if (context.beginPath(), context.arc(x, y, radius + sign * d, startAngle, endAngle), context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(circle, circle.attribute, circleAttribute), strokeCb) strokeCb(context, borderStyle, circleAttribute[key]);else if (doStroke) {
|
|
12102
12232
|
const lastOpacity = circleAttribute[key].opacity;
|
|
@@ -12215,7 +12345,8 @@ class DefaultRectRenderContribution {
|
|
|
12215
12345
|
scaleX = rectAttribute.scaleX,
|
|
12216
12346
|
scaleY = rectAttribute.scaleY,
|
|
12217
12347
|
x1: x1,
|
|
12218
|
-
y1: y1
|
|
12348
|
+
y1: y1,
|
|
12349
|
+
keepStrokeScale = rectAttribute.keepStrokeScale
|
|
12219
12350
|
} = rect.attribute;
|
|
12220
12351
|
let {
|
|
12221
12352
|
width: width,
|
|
@@ -12228,7 +12359,7 @@ class DefaultRectRenderContribution {
|
|
|
12228
12359
|
{
|
|
12229
12360
|
distance = rectAttribute[key].distance
|
|
12230
12361
|
} = borderStyle,
|
|
12231
|
-
d = getScaledStroke(context, distance, context.dpr),
|
|
12362
|
+
d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr),
|
|
12232
12363
|
nextX = x + sign * d,
|
|
12233
12364
|
nextY = y + sign * d,
|
|
12234
12365
|
dw = 2 * d;
|
|
@@ -12358,9 +12489,8 @@ class DefaultImageRenderContribution extends DefaultRectRenderContribution {
|
|
|
12358
12489
|
constructor() {
|
|
12359
12490
|
super(...arguments), this.time = BaseRenderContributionTime.afterFillStroke, this.useStyle = !0, this.order = 0;
|
|
12360
12491
|
}
|
|
12361
|
-
drawShape(
|
|
12362
|
-
|
|
12363
|
-
image.renderFrame(context, x, y);
|
|
12492
|
+
drawShape(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb) {
|
|
12493
|
+
return super.drawShape(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb);
|
|
12364
12494
|
}
|
|
12365
12495
|
}
|
|
12366
12496
|
const defaultImageRenderContribution = new DefaultImageRenderContribution();
|
|
@@ -12386,14 +12516,15 @@ class DefaultSymbolRenderContribution {
|
|
|
12386
12516
|
x: originX = symbolAttribute.x,
|
|
12387
12517
|
y: originY = symbolAttribute.y,
|
|
12388
12518
|
scaleX = symbolAttribute.scaleX,
|
|
12389
|
-
scaleY = symbolAttribute.scaleY
|
|
12519
|
+
scaleY = symbolAttribute.scaleY,
|
|
12520
|
+
keepStrokeScale = symbolAttribute.keepStrokeScale
|
|
12390
12521
|
} = symbol.attribute,
|
|
12391
12522
|
renderBorder = (borderStyle, key) => {
|
|
12392
12523
|
const doStroke = !(!borderStyle || !borderStyle.stroke),
|
|
12393
12524
|
{
|
|
12394
12525
|
distance = symbolAttribute[key].distance
|
|
12395
12526
|
} = borderStyle,
|
|
12396
|
-
d = getScaledStroke(context, distance, context.dpr),
|
|
12527
|
+
d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr),
|
|
12397
12528
|
sign = "outerBorder" === key ? 1 : -1;
|
|
12398
12529
|
if (context.beginPath(), !1 === parsedPath.drawOffset(context, size, x, y, sign * d) && context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute), strokeCb) strokeCb(context, borderStyle, symbolAttribute[key]);else if (doStroke) {
|
|
12399
12530
|
const lastOpacity = symbolAttribute[key].opacity;
|
|
@@ -13671,16 +13802,8 @@ let DefaultCanvasTextRender = class extends BaseRender {
|
|
|
13671
13802
|
verticalMode = textAttribute.verticalMode,
|
|
13672
13803
|
x: originX = textAttribute.x,
|
|
13673
13804
|
y: originY = textAttribute.y
|
|
13674
|
-
} = text.attribute
|
|
13675
|
-
|
|
13676
|
-
textAlign = textAttribute.textAlign,
|
|
13677
|
-
textBaseline = textAttribute.textBaseline
|
|
13678
|
-
} = text.attribute;
|
|
13679
|
-
if (!verticalMode && "vertical" === direction) {
|
|
13680
|
-
const t = textAlign;
|
|
13681
|
-
textAlign = null !== (_a = text.getBaselineMapAlign()[textBaseline]) && void 0 !== _a ? _a : "left", textBaseline = null !== (_b = text.getAlignMapBaseline()[t]) && void 0 !== _b ? _b : "top";
|
|
13682
|
-
}
|
|
13683
|
-
const lineHeight = null !== (_c = calculateLineHeight(text.attribute.lineHeight, fontSize)) && void 0 !== _c ? _c : fontSize,
|
|
13805
|
+
} = text.attribute,
|
|
13806
|
+
lineHeight = null !== (_a = calculateLineHeight(text.attribute.lineHeight, fontSize)) && void 0 !== _a ? _a : fontSize,
|
|
13684
13807
|
data = this.valid(text, textAttribute, fillCb, strokeCb);
|
|
13685
13808
|
if (!data) return;
|
|
13686
13809
|
const {
|
|
@@ -13700,79 +13823,60 @@ let DefaultCanvasTextRender = class extends BaseRender {
|
|
|
13700
13823
|
const matrix = matrixAllocate.allocate(1, 0, 0, 1, 0, 0);
|
|
13701
13824
|
matrix.rotateByCenter(Math.PI / 2, _x, _y), context.transformFromMatrix(matrix, !0), matrixAllocate.free(matrix);
|
|
13702
13825
|
}
|
|
13703
|
-
doStroke && (strokeCb ? strokeCb(context, text.attribute, textAttribute) : sVisible && (context.setStrokeStyle(text, text.attribute, originX - x, originY - y, textAttribute), context.strokeText(t, _x, _y, z))), doFill && (fillCb ? fillCb(context, text.attribute, textAttribute) : fVisible && (context.setCommonStyle(text, text.attribute, originX - x, originY - y, textAttribute), context.fillText(t, _x, _y, z)
|
|
13826
|
+
doStroke && (strokeCb ? strokeCb(context, text.attribute, textAttribute) : sVisible && (context.setStrokeStyle(text, text.attribute, originX - x, originY - y, textAttribute), context.strokeText(t, _x, _y, z))), doFill && (fillCb ? fillCb(context, text.attribute, textAttribute) : fVisible && (context.setCommonStyle(text, text.attribute, originX - x, originY - y, textAttribute), context.fillText(t, _x, _y, z))), direction && (context.highPerformanceRestore(), context.setTransformForCurrent());
|
|
13704
13827
|
};
|
|
13705
|
-
if (text.
|
|
13706
|
-
|
|
13707
|
-
|
|
13708
|
-
|
|
13709
|
-
|
|
13710
|
-
|
|
13711
|
-
|
|
13712
|
-
|
|
13713
|
-
|
|
13714
|
-
|
|
13715
|
-
|
|
13716
|
-
|
|
13717
|
-
|
|
13718
|
-
|
|
13719
|
-
width: line.width
|
|
13720
|
-
});
|
|
13721
|
-
})));
|
|
13722
|
-
} else {
|
|
13723
|
-
text.tryUpdateAABBBounds();
|
|
13724
|
-
const cache = text.cache,
|
|
13725
|
-
{
|
|
13726
|
-
verticalList: verticalList
|
|
13727
|
-
} = cache;
|
|
13728
|
-
context.textAlign = "left", context.textBaseline = "top";
|
|
13729
|
-
const totalHeight = lineHeight * verticalList.length;
|
|
13730
|
-
let totalW = 0;
|
|
13731
|
-
verticalList.forEach(verticalData => {
|
|
13732
|
-
const _w = verticalData.reduce((a, b) => a + (b.width || 0), 0);
|
|
13733
|
-
totalW = max(_w, totalW);
|
|
13734
|
-
});
|
|
13735
|
-
let offsetY = 0,
|
|
13736
|
-
offsetX = 0;
|
|
13737
|
-
"bottom" === textBaseline ? offsetX = -totalHeight : "middle" === textBaseline && (offsetX = -totalHeight / 2), "center" === textAlign ? offsetY -= totalW / 2 : "right" === textAlign && (offsetY -= totalW), verticalList.forEach((verticalData, i) => {
|
|
13738
|
-
const currentW = verticalData.reduce((a, b) => a + (b.width || 0), 0),
|
|
13739
|
-
dw = totalW - currentW;
|
|
13740
|
-
let currentOffsetY = offsetY;
|
|
13741
|
-
"center" === textAlign ? currentOffsetY += dw / 2 : "right" === textAlign && (currentOffsetY += dw), verticalData.forEach(item => {
|
|
13742
|
-
const {
|
|
13743
|
-
text: text,
|
|
13744
|
-
width: width,
|
|
13745
|
-
direction: direction
|
|
13746
|
-
} = item;
|
|
13747
|
-
drawText(text, totalHeight - (i + 1) * lineHeight + offsetX, currentOffsetY, direction), currentOffsetY += width;
|
|
13748
|
-
});
|
|
13828
|
+
if (context.setTextStyleWithoutAlignBaseline(text.attribute, textAttribute, z), "horizontal" === direction) {
|
|
13829
|
+
const {
|
|
13830
|
+
multilineLayout: multilineLayout
|
|
13831
|
+
} = text;
|
|
13832
|
+
if (!multilineLayout) return void context.highPerformanceRestore();
|
|
13833
|
+
const {
|
|
13834
|
+
xOffset: xOffset,
|
|
13835
|
+
yOffset: yOffset
|
|
13836
|
+
} = multilineLayout.bbox;
|
|
13837
|
+
doStroke && (strokeCb ? strokeCb(context, text.attribute, textAttribute) : sVisible && (context.setStrokeStyle(text, text.attribute, originX - x, originY - y, textAttribute), multilineLayout.lines.forEach(line => {
|
|
13838
|
+
context.strokeText(line.str, (line.leftOffset || 0) + xOffset + x, (line.topOffset || 0) + yOffset + y, z);
|
|
13839
|
+
}))), doFill && (fillCb ? fillCb(context, text.attribute, textAttribute) : fVisible && (context.setCommonStyle(text, text.attribute, originX - x, originY - y, textAttribute), multilineLayout.lines.forEach(line => {
|
|
13840
|
+
context.fillText(line.str, (line.leftOffset || 0) + xOffset + x, (line.topOffset || 0) + yOffset + y, z), 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, {
|
|
13841
|
+
width: line.width
|
|
13749
13842
|
});
|
|
13750
|
-
}
|
|
13751
|
-
} else if ("horizontal" === direction) {
|
|
13752
|
-
context.setTextStyle(text.attribute, textAttribute, z);
|
|
13753
|
-
const t = text.clipedText;
|
|
13754
|
-
let dy = 0;
|
|
13755
|
-
lineHeight !== fontSize && ("top" === textBaseline ? dy = (lineHeight - fontSize) / 2 : "middle" === textBaseline || "bottom" === textBaseline && (dy = -(lineHeight - fontSize) / 2)), drawText(t, 0, dy, 0);
|
|
13843
|
+
})));
|
|
13756
13844
|
} else {
|
|
13845
|
+
let {
|
|
13846
|
+
textAlign = textAttribute.textAlign,
|
|
13847
|
+
textBaseline = textAttribute.textBaseline
|
|
13848
|
+
} = text.attribute;
|
|
13849
|
+
if (!verticalMode) {
|
|
13850
|
+
const t = textAlign;
|
|
13851
|
+
textAlign = null !== (_b = text.getBaselineMapAlign()[textBaseline]) && void 0 !== _b ? _b : "left", textBaseline = null !== (_c = text.getAlignMapBaseline()[t]) && void 0 !== _c ? _c : "top";
|
|
13852
|
+
}
|
|
13757
13853
|
text.tryUpdateAABBBounds();
|
|
13758
|
-
const cache = text.cache
|
|
13759
|
-
|
|
13760
|
-
context.setTextStyleWithoutAlignBaseline(text.attribute, textAttribute, z);
|
|
13761
|
-
const {
|
|
13854
|
+
const cache = text.cache,
|
|
13855
|
+
{
|
|
13762
13856
|
verticalList: verticalList
|
|
13763
13857
|
} = cache;
|
|
13764
|
-
|
|
13765
|
-
|
|
13766
|
-
|
|
13767
|
-
|
|
13858
|
+
context.textAlign = "left", context.textBaseline = "top";
|
|
13859
|
+
const totalHeight = lineHeight * verticalList.length;
|
|
13860
|
+
let totalW = 0;
|
|
13861
|
+
verticalList.forEach(verticalData => {
|
|
13862
|
+
const _w = verticalData.reduce((a, b) => a + (b.width || 0), 0);
|
|
13863
|
+
totalW = max(_w, totalW);
|
|
13864
|
+
});
|
|
13865
|
+
let offsetY = 0,
|
|
13866
|
+
offsetX = 0;
|
|
13867
|
+
"bottom" === textBaseline ? offsetX = -totalHeight : "middle" === textBaseline && (offsetX = -totalHeight / 2), "center" === textAlign ? offsetY -= totalW / 2 : "right" === textAlign && (offsetY -= totalW), verticalList.forEach((verticalData, i) => {
|
|
13868
|
+
const currentW = verticalData.reduce((a, b) => a + (b.width || 0), 0),
|
|
13869
|
+
dw = totalW - currentW;
|
|
13870
|
+
let currentOffsetY = offsetY;
|
|
13871
|
+
"center" === textAlign ? currentOffsetY += dw / 2 : "right" === textAlign && (currentOffsetY += dw), verticalData.forEach(item => {
|
|
13768
13872
|
const {
|
|
13769
13873
|
text: text,
|
|
13770
13874
|
width: width,
|
|
13771
13875
|
direction: direction
|
|
13772
13876
|
} = item;
|
|
13773
|
-
drawText(text, offsetX,
|
|
13877
|
+
drawText(text, totalHeight - (i + 1) * lineHeight + offsetX, currentOffsetY, direction), currentOffsetY += width;
|
|
13774
13878
|
});
|
|
13775
|
-
}
|
|
13879
|
+
});
|
|
13776
13880
|
}
|
|
13777
13881
|
transform3dMatrixToContextMatrix && this.restoreTransformUseContext2d(text, textAttribute, z, context), this.afterRenderStep(text, context, x, y, doFill, doStroke, fVisible, sVisible, textAttribute, drawContext, fillCb, strokeCb);
|
|
13778
13882
|
}
|
|
@@ -13784,12 +13888,10 @@ let DefaultCanvasTextRender = class extends BaseRender {
|
|
|
13784
13888
|
computed3dMatrix = !keepDirIn3d;
|
|
13785
13889
|
this._draw(text, textAttribute, computed3dMatrix, drawContext, params);
|
|
13786
13890
|
}
|
|
13787
|
-
drawUnderLine(underline, lineThrough, text,
|
|
13891
|
+
drawUnderLine(underline, lineThrough, text, anchorX, anchorY, offsetUnderLineY, offsetThroughLineY, z, textAttribute, context, multiOption) {
|
|
13788
13892
|
if (lineThrough + underline <= 0) return;
|
|
13789
13893
|
const {
|
|
13790
13894
|
textAlign = textAttribute.textAlign,
|
|
13791
|
-
textBaseline = textAttribute.textBaseline,
|
|
13792
|
-
fontSize = textAttribute.fontSize,
|
|
13793
13895
|
fill = textAttribute.fill,
|
|
13794
13896
|
opacity = textAttribute.opacity,
|
|
13795
13897
|
underlineOffset = textAttribute.underlineOffset,
|
|
@@ -13799,23 +13901,21 @@ let DefaultCanvasTextRender = class extends BaseRender {
|
|
|
13799
13901
|
isMulti = !isNil$1(multiOption),
|
|
13800
13902
|
w = isMulti ? multiOption.width : text.clipedWidth,
|
|
13801
13903
|
offsetX = isMulti ? 0 : textDrawOffsetX(textAlign, w),
|
|
13802
|
-
offsetY = textLayoutOffsetY(isMulti ? "alphabetic" : textBaseline, fontSize, fontSize),
|
|
13803
13904
|
attribute = {
|
|
13804
13905
|
lineWidth: 0,
|
|
13805
13906
|
stroke: fill,
|
|
13806
13907
|
opacity: opacity,
|
|
13807
13908
|
strokeOpacity: fillOpacity
|
|
13808
13909
|
};
|
|
13809
|
-
let deltaY = isMulti ? -3 : 0;
|
|
13810
13910
|
if (underline) {
|
|
13811
|
-
attribute.lineWidth = underline, context.setStrokeStyle(text, attribute,
|
|
13812
|
-
const dy =
|
|
13813
|
-
context.moveTo(
|
|
13911
|
+
attribute.lineWidth = underline, context.setStrokeStyle(text, attribute, anchorX, anchorY, textAttribute), underlineDash && context.setLineDash(underlineDash), context.beginPath();
|
|
13912
|
+
const dy = anchorY + offsetUnderLineY + underlineOffset;
|
|
13913
|
+
context.moveTo(anchorX + offsetX, dy, z), context.lineTo(anchorX + offsetX + w, dy, z), context.stroke();
|
|
13814
13914
|
}
|
|
13815
|
-
if (
|
|
13816
|
-
attribute.lineWidth = lineThrough, context.setStrokeStyle(text, attribute,
|
|
13817
|
-
const dy =
|
|
13818
|
-
context.moveTo(
|
|
13915
|
+
if (lineThrough) {
|
|
13916
|
+
attribute.lineWidth = lineThrough, context.setStrokeStyle(text, attribute, anchorX, anchorY, textAttribute), context.beginPath();
|
|
13917
|
+
const dy = anchorY + offsetThroughLineY;
|
|
13918
|
+
context.moveTo(anchorX + offsetX, dy, z), context.lineTo(anchorX + offsetX + w, dy, z), context.stroke();
|
|
13819
13919
|
}
|
|
13820
13920
|
}
|
|
13821
13921
|
};
|
|
@@ -14110,12 +14210,10 @@ let DefaultCanvasImageRender = class extends BaseRender {
|
|
|
14110
14210
|
const {
|
|
14111
14211
|
image: url
|
|
14112
14212
|
} = image.attribute;
|
|
14113
|
-
if (!image.
|
|
14114
|
-
|
|
14115
|
-
|
|
14116
|
-
|
|
14117
|
-
if ("success" !== res.state) return;
|
|
14118
|
-
}
|
|
14213
|
+
if (!url || !image.resources) return;
|
|
14214
|
+
const res = image.resources.get(url);
|
|
14215
|
+
if ("loading" === res.state && isString$1(url)) return void ResourceLoader.improveImageLoading(url);
|
|
14216
|
+
if ("success" !== res.state) return;
|
|
14119
14217
|
const {
|
|
14120
14218
|
context: context
|
|
14121
14219
|
} = renderService.drawParams;
|
|
@@ -14507,51 +14605,45 @@ class CanvasTextLayout {
|
|
|
14507
14605
|
}
|
|
14508
14606
|
return bbox.yOffset = "top" === textBaseline ? 0 : "middle" === textBaseline ? bbox.height / -2 : "alphabetic" === textBaseline ? -.79 * bbox.height : -bbox.height, bbox;
|
|
14509
14607
|
}
|
|
14510
|
-
GetLayout(str, width, height, textAlign, textBaseline, lineHeight, suffix, wordBreak, suffixPosition) {
|
|
14511
|
-
const linesLayout = [],
|
|
14512
|
-
bboxWH = [width, height],
|
|
14513
|
-
bboxOffset = [0, 0];
|
|
14514
|
-
for (; str.length > 0;) {
|
|
14515
|
-
const {
|
|
14516
|
-
str: clipText
|
|
14517
|
-
} = this.textMeasure.clipTextWithSuffix(str, this.textOptions, width, suffix, wordBreak, suffixPosition);
|
|
14518
|
-
linesLayout.push({
|
|
14519
|
-
str: clipText,
|
|
14520
|
-
width: this.textMeasure.measureTextWidth(clipText, this.textOptions)
|
|
14521
|
-
}), str = str.substring(clipText.length);
|
|
14522
|
-
}
|
|
14523
|
-
"left" === textAlign || "start" === textAlign || ("center" === textAlign ? bboxOffset[0] = bboxWH[0] / -2 : "right" !== textAlign && "end" !== textAlign || (bboxOffset[0] = -bboxWH[0])), "top" === textBaseline || ("middle" === textBaseline ? bboxOffset[1] = bboxWH[1] / -2 : "bottom" === textBaseline && (bboxOffset[1] = -bboxWH[1]));
|
|
14524
|
-
const bbox = {
|
|
14525
|
-
xOffset: bboxOffset[0],
|
|
14526
|
-
yOffset: bboxOffset[1],
|
|
14527
|
-
width: bboxWH[0],
|
|
14528
|
-
height: bboxWH[1]
|
|
14529
|
-
};
|
|
14530
|
-
return this.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline, lineHeight);
|
|
14531
|
-
}
|
|
14532
14608
|
GetLayoutByLines(lines, textAlign, textBaseline, lineHeight) {
|
|
14533
14609
|
let suffix = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : "";
|
|
14534
14610
|
let wordBreak = arguments.length > 5 ? arguments[5] : undefined;
|
|
14535
|
-
let
|
|
14536
|
-
|
|
14611
|
+
let params = arguments.length > 6 ? arguments[6] : undefined;
|
|
14612
|
+
const {
|
|
14613
|
+
lineWidth: lineWidth,
|
|
14614
|
+
suffixPosition = "end",
|
|
14615
|
+
measureMode = MeasureModeEnum.actualBounding
|
|
14616
|
+
} = null != params ? params : {};
|
|
14537
14617
|
lines = lines.map(l => l.toString());
|
|
14538
14618
|
const linesLayout = [],
|
|
14539
14619
|
bboxWH = [0, 0];
|
|
14540
14620
|
if ("number" == typeof lineWidth && lineWidth !== 1 / 0) {
|
|
14541
14621
|
let width;
|
|
14542
|
-
for (let i = 0, len = lines.length; i < len; i++)
|
|
14543
|
-
|
|
14544
|
-
width
|
|
14545
|
-
|
|
14622
|
+
for (let i = 0, len = lines.length; i < len; i++) {
|
|
14623
|
+
const metrics = this.textMeasure.measureTextPixelADscentAndWidth(lines[i], this.textOptions, measureMode);
|
|
14624
|
+
width = Math.min(metrics.width, lineWidth), linesLayout.push({
|
|
14625
|
+
str: metrics.width <= lineWidth ? lines[i].toString() : this.textMeasure.clipTextWithSuffix(lines[i], this.textOptions, width, suffix, wordBreak, suffixPosition).str,
|
|
14626
|
+
width: width,
|
|
14627
|
+
ascent: metrics.ascent,
|
|
14628
|
+
descent: metrics.descent
|
|
14629
|
+
});
|
|
14630
|
+
}
|
|
14546
14631
|
bboxWH[0] = lineWidth;
|
|
14547
14632
|
} else {
|
|
14548
|
-
let width,
|
|
14549
|
-
|
|
14550
|
-
|
|
14551
|
-
|
|
14552
|
-
|
|
14553
|
-
|
|
14554
|
-
|
|
14633
|
+
let width,
|
|
14634
|
+
text,
|
|
14635
|
+
_lineWidth = 0;
|
|
14636
|
+
for (let i = 0, len = lines.length; i < len; i++) {
|
|
14637
|
+
text = lines[i];
|
|
14638
|
+
const metrics = this.textMeasure.measureTextPixelADscentAndWidth(lines[i], this.textOptions, measureMode);
|
|
14639
|
+
width = metrics.width, _lineWidth = Math.max(_lineWidth, width), linesLayout.push({
|
|
14640
|
+
str: text,
|
|
14641
|
+
width: width,
|
|
14642
|
+
ascent: metrics.ascent,
|
|
14643
|
+
descent: metrics.descent
|
|
14644
|
+
});
|
|
14645
|
+
}
|
|
14646
|
+
bboxWH[0] = _lineWidth;
|
|
14555
14647
|
}
|
|
14556
14648
|
bboxWH[1] = linesLayout.length * lineHeight, bboxWH[0] = linesLayout.reduce((a, b) => Math.max(a, b.width), 0);
|
|
14557
14649
|
const bbox = {
|
|
@@ -14579,11 +14671,11 @@ class CanvasTextLayout {
|
|
|
14579
14671
|
};
|
|
14580
14672
|
}
|
|
14581
14673
|
lineOffset(bbox, line, textAlign, textBaseline, lineHeight, origin) {
|
|
14582
|
-
return "left" === textAlign || "start" === textAlign ? line.leftOffset = 0 : "center" === textAlign ? line.leftOffset = (bbox.width - line.width) / 2 : "right" !== textAlign && "end" !== textAlign || (line.leftOffset = bbox.width - line.width), line.topOffset =
|
|
14674
|
+
return "left" === textAlign || "start" === textAlign ? line.leftOffset = 0 : "center" === textAlign ? line.leftOffset = (bbox.width - line.width) / 2 : "right" !== textAlign && "end" !== textAlign || (line.leftOffset = bbox.width - line.width), line.topOffset = lineHeight / 2 + (line.ascent - line.descent) / 2 + origin[1], origin[1] += lineHeight, line;
|
|
14583
14675
|
}
|
|
14584
14676
|
}
|
|
14585
14677
|
|
|
14586
|
-
const TEXT_UPDATE_TAG_KEY = ["text", "maxLineWidth", "textAlign", "textBaseline", "heightLimit", "lineClamp", "fontSize", "fontFamily", "fontWeight", "ellipsis", "lineHeight", "direction", "wordBreak", "heightLimit", "lineClamp", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
14678
|
+
const TEXT_UPDATE_TAG_KEY = ["text", "maxLineWidth", "maxWidth", "textAlign", "textBaseline", "heightLimit", "lineClamp", "fontSize", "fontFamily", "fontWeight", "ellipsis", "lineHeight", "direction", "wordBreak", "heightLimit", "lineClamp", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
14587
14679
|
class Text extends Graphic {
|
|
14588
14680
|
get font() {
|
|
14589
14681
|
const textTheme = this.getGraphicTheme();
|
|
@@ -14592,26 +14684,22 @@ class Text extends Graphic {
|
|
|
14592
14684
|
get clipedText() {
|
|
14593
14685
|
var _a;
|
|
14594
14686
|
const attribute = this.attribute,
|
|
14595
|
-
textTheme = this.getGraphicTheme()
|
|
14596
|
-
|
|
14597
|
-
|
|
14598
|
-
maxLineWidth = textTheme.maxLineWidth
|
|
14599
|
-
} = attribute;
|
|
14600
|
-
return Number.isFinite(maxLineWidth) ? (this.tryUpdateAABBBounds(), this.cache.clipedText) : (null !== (_a = attribute.text) && void 0 !== _a ? _a : textTheme.text).toString();
|
|
14687
|
+
textTheme = this.getGraphicTheme(),
|
|
14688
|
+
maxWidth = this.getMaxWidth(textTheme);
|
|
14689
|
+
return Number.isFinite(maxWidth) ? (this.tryUpdateAABBBounds(), this.cache.clipedText) : (null !== (_a = attribute.text) && void 0 !== _a ? _a : textTheme.text).toString();
|
|
14601
14690
|
}
|
|
14602
14691
|
get clipedWidth() {
|
|
14603
|
-
|
|
14692
|
+
return this.tryUpdateAABBBounds(), this.cache.clipedWidth;
|
|
14604
14693
|
}
|
|
14605
14694
|
get cliped() {
|
|
14606
14695
|
var _a, _b;
|
|
14607
14696
|
const textTheme = this.getGraphicTheme(),
|
|
14608
14697
|
attribute = this.attribute,
|
|
14609
|
-
|
|
14610
|
-
|
|
14611
|
-
|
|
14612
|
-
|
|
14613
|
-
|
|
14614
|
-
if (!Number.isFinite(maxLineWidth)) return !1;
|
|
14698
|
+
maxWidth = this.getMaxWidth(textTheme);
|
|
14699
|
+
if (!Number.isFinite(maxWidth)) return !1;
|
|
14700
|
+
const {
|
|
14701
|
+
text: text
|
|
14702
|
+
} = this.attribute;
|
|
14615
14703
|
if (this.tryUpdateAABBBounds(), null === (_b = null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData) || void 0 === _b ? void 0 : _b.lines) {
|
|
14616
14704
|
let mergedText = "";
|
|
14617
14705
|
this.cache.layoutData.lines.forEach(item => {
|
|
@@ -14622,10 +14710,7 @@ class Text extends Graphic {
|
|
|
14622
14710
|
return "vertical" === attribute.direction && this.cache.verticalList && this.cache.verticalList[0] ? this.cache.verticalList[0].map(item => item.text).join("") !== attribute.text.toString() : null != this.clipedText && this.clipedText !== attribute.text.toString();
|
|
14623
14711
|
}
|
|
14624
14712
|
get multilineLayout() {
|
|
14625
|
-
|
|
14626
|
-
}
|
|
14627
|
-
isSimplify() {
|
|
14628
|
-
return !this.isMultiLine && "vertical" !== this.attribute.direction;
|
|
14713
|
+
return this.tryUpdateAABBBounds(), this.cache.layoutData;
|
|
14629
14714
|
}
|
|
14630
14715
|
get isMultiLine() {
|
|
14631
14716
|
return Array.isArray(this.attribute.text) || "normal" === this.attribute.whiteSpace;
|
|
@@ -14698,8 +14783,72 @@ class Text extends Graphic {
|
|
|
14698
14783
|
}
|
|
14699
14784
|
return application.graphicService.combindShadowAABBBounds(aabbBounds, this), null == attribute.forceBoundsHeight && null == attribute.forceBoundsWidth || application.graphicService.updateHTMLTextAABBBounds(attribute, textTheme, aabbBounds), transformBoundsWithMatrix(aabbBounds, aabbBounds, this.transMatrix), aabbBounds;
|
|
14700
14785
|
}
|
|
14786
|
+
updateSingallineAABBBounds(text) {
|
|
14787
|
+
this.updateMultilineAABBBounds([text]);
|
|
14788
|
+
const layoutData = this.cache.layoutData;
|
|
14789
|
+
if (layoutData) {
|
|
14790
|
+
const line = layoutData.lines[0];
|
|
14791
|
+
this.cache.clipedText = line.str, this.cache.clipedWidth = line.width;
|
|
14792
|
+
}
|
|
14793
|
+
return this._AABBBounds;
|
|
14794
|
+
}
|
|
14795
|
+
updateMultilineAABBBounds(text) {
|
|
14796
|
+
const textTheme = this.getGraphicTheme(),
|
|
14797
|
+
{
|
|
14798
|
+
direction = textTheme.direction,
|
|
14799
|
+
underlineOffset = textTheme.underlineOffset
|
|
14800
|
+
} = this.attribute,
|
|
14801
|
+
b = "horizontal" === direction ? this.updateHorizontalMultilineAABBBounds(text) : this.updateVerticalMultilineAABBBounds(text);
|
|
14802
|
+
return "horizontal" === direction && underlineOffset && this._AABBBounds.add(this._AABBBounds.x1, this._AABBBounds.y2 + underlineOffset), b;
|
|
14803
|
+
}
|
|
14804
|
+
guessLineHeightBuf(fontSize) {
|
|
14805
|
+
return fontSize ? .1 * fontSize : 0;
|
|
14806
|
+
}
|
|
14807
|
+
updateHorizontalMultilineAABBBounds(text) {
|
|
14808
|
+
var _a;
|
|
14809
|
+
const textTheme = this.getGraphicTheme(),
|
|
14810
|
+
attribute = this.attribute,
|
|
14811
|
+
{
|
|
14812
|
+
fontFamily = textTheme.fontFamily,
|
|
14813
|
+
textAlign = textTheme.textAlign,
|
|
14814
|
+
textBaseline = textTheme.textBaseline,
|
|
14815
|
+
fontSize = textTheme.fontSize,
|
|
14816
|
+
fontWeight = textTheme.fontWeight,
|
|
14817
|
+
ellipsis = textTheme.ellipsis,
|
|
14818
|
+
maxLineWidth: maxLineWidth,
|
|
14819
|
+
stroke = textTheme.stroke,
|
|
14820
|
+
wrap = textTheme.wrap,
|
|
14821
|
+
measureMode = textTheme.measureMode,
|
|
14822
|
+
lineWidth = textTheme.lineWidth,
|
|
14823
|
+
whiteSpace = textTheme.whiteSpace,
|
|
14824
|
+
suffixPosition = textTheme.suffixPosition,
|
|
14825
|
+
ignoreBuf = textTheme.ignoreBuf
|
|
14826
|
+
} = attribute,
|
|
14827
|
+
buf = ignoreBuf ? 0 : this.guessLineHeightBuf(fontSize),
|
|
14828
|
+
lineHeight = this.getLineHeight(attribute, textTheme) + buf;
|
|
14829
|
+
if ("normal" === whiteSpace || wrap) return this.updateWrapAABBBounds(text);
|
|
14830
|
+
if (!this.shouldUpdateShape() && (null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData)) {
|
|
14831
|
+
const bbox = this.cache.layoutData.bbox;
|
|
14832
|
+
return this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
14833
|
+
}
|
|
14834
|
+
const textMeasure = application.graphicUtil.textMeasure,
|
|
14835
|
+
layoutData = new CanvasTextLayout(fontFamily, {
|
|
14836
|
+
fontSize: fontSize,
|
|
14837
|
+
fontWeight: fontWeight,
|
|
14838
|
+
fontFamily: fontFamily,
|
|
14839
|
+
lineHeight: lineHeight
|
|
14840
|
+
}, textMeasure).GetLayoutByLines(text, textAlign, textBaseline, lineHeight, !0 === ellipsis ? textTheme.ellipsis : ellipsis || void 0, !1, {
|
|
14841
|
+
lineWidth: maxLineWidth,
|
|
14842
|
+
suffixPosition: suffixPosition,
|
|
14843
|
+
measureMode: measureMode
|
|
14844
|
+
}),
|
|
14845
|
+
{
|
|
14846
|
+
bbox: bbox
|
|
14847
|
+
} = layoutData;
|
|
14848
|
+
return this.cache.layoutData = layoutData, this.clearUpdateShapeTag(), this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
14849
|
+
}
|
|
14701
14850
|
updateWrapAABBBounds(text) {
|
|
14702
|
-
var _a, _b, _c
|
|
14851
|
+
var _a, _b, _c;
|
|
14703
14852
|
const textTheme = this.getGraphicTheme(),
|
|
14704
14853
|
{
|
|
14705
14854
|
fontFamily = textTheme.fontFamily,
|
|
@@ -14713,22 +14862,25 @@ class Text extends Graphic {
|
|
|
14713
14862
|
wordBreak = textTheme.wordBreak,
|
|
14714
14863
|
fontWeight = textTheme.fontWeight,
|
|
14715
14864
|
ignoreBuf = textTheme.ignoreBuf,
|
|
14865
|
+
measureMode = textTheme.measureMode,
|
|
14716
14866
|
suffixPosition = textTheme.suffixPosition,
|
|
14717
14867
|
heightLimit = 0,
|
|
14718
14868
|
lineClamp: lineClamp
|
|
14719
14869
|
} = this.attribute,
|
|
14720
|
-
|
|
14721
|
-
|
|
14722
|
-
if (!this.shouldUpdateShape() && (null === (
|
|
14870
|
+
buf = ignoreBuf ? 0 : this.guessLineHeightBuf(fontSize),
|
|
14871
|
+
lineHeight = this.getLineHeight(this.attribute, textTheme) + buf;
|
|
14872
|
+
if (!this.shouldUpdateShape() && (null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData)) {
|
|
14723
14873
|
const bbox = this.cache.layoutData.bbox;
|
|
14724
14874
|
return this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
14725
14875
|
}
|
|
14726
14876
|
const textMeasure = application.graphicUtil.textMeasure,
|
|
14727
|
-
|
|
14877
|
+
textOptions = {
|
|
14728
14878
|
fontSize: fontSize,
|
|
14729
14879
|
fontWeight: fontWeight,
|
|
14730
|
-
fontFamily: fontFamily
|
|
14731
|
-
|
|
14880
|
+
fontFamily: fontFamily,
|
|
14881
|
+
lineHeight: lineHeight
|
|
14882
|
+
},
|
|
14883
|
+
layoutObj = new CanvasTextLayout(fontFamily, textOptions, textMeasure),
|
|
14732
14884
|
lines = isArray$1(text) ? text.map(l => l.toString()) : [text.toString()],
|
|
14733
14885
|
linesLayout = [],
|
|
14734
14886
|
bboxWH = [0, 0];
|
|
@@ -14738,29 +14890,35 @@ class Text extends Graphic {
|
|
|
14738
14890
|
const str = lines[i];
|
|
14739
14891
|
let needCut = !0;
|
|
14740
14892
|
if (i === lineCountLimit - 1) {
|
|
14741
|
-
const clip =
|
|
14893
|
+
const clip = textMeasure.clipTextWithSuffix(str, textOptions, maxLineWidth, ellipsis, !1, suffixPosition, i !== lines.length - 1),
|
|
14894
|
+
matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);
|
|
14742
14895
|
linesLayout.push({
|
|
14743
14896
|
str: clip.str,
|
|
14744
|
-
width: clip.width
|
|
14897
|
+
width: clip.width,
|
|
14898
|
+
ascent: matrics.ascent,
|
|
14899
|
+
descent: matrics.descent
|
|
14745
14900
|
});
|
|
14746
14901
|
break;
|
|
14747
14902
|
}
|
|
14748
|
-
const clip =
|
|
14903
|
+
const clip = textMeasure.clipText(str, textOptions, maxLineWidth, "break-all" !== wordBreak, "keep-all" === wordBreak);
|
|
14749
14904
|
if ("" !== str && "" === clip.str || clip.wordBreaked) {
|
|
14750
14905
|
if (ellipsis) {
|
|
14751
|
-
const clipEllipsis =
|
|
14752
|
-
clip.str = null !== (
|
|
14906
|
+
const clipEllipsis = textMeasure.clipTextWithSuffix(str, textOptions, maxLineWidth, ellipsis, !1, suffixPosition);
|
|
14907
|
+
clip.str = null !== (_b = clipEllipsis.str) && void 0 !== _b ? _b : "", clip.width = null !== (_c = clipEllipsis.width) && void 0 !== _c ? _c : 0;
|
|
14753
14908
|
} else clip.str = "", clip.width = 0;
|
|
14754
14909
|
needCut = !1;
|
|
14755
14910
|
}
|
|
14911
|
+
const matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);
|
|
14756
14912
|
linesLayout.push({
|
|
14757
14913
|
str: clip.str,
|
|
14758
|
-
width: clip.width
|
|
14914
|
+
width: clip.width,
|
|
14915
|
+
ascent: matrics.ascent,
|
|
14916
|
+
descent: matrics.descent
|
|
14759
14917
|
});
|
|
14760
14918
|
let cutLength = clip.str.length;
|
|
14761
14919
|
if (!clip.wordBreaked || "" !== str && "" === clip.str || (needCut = !0, cutLength = clip.wordBreaked), clip.str.length === str.length) ;else if (needCut) {
|
|
14762
|
-
|
|
14763
|
-
|
|
14920
|
+
const newStr = str.substring(cutLength);
|
|
14921
|
+
lines.splice(i + 1, 0, newStr);
|
|
14764
14922
|
}
|
|
14765
14923
|
}
|
|
14766
14924
|
let maxWidth = 0;
|
|
@@ -14773,21 +14931,28 @@ class Text extends Graphic {
|
|
|
14773
14931
|
lineWidth = 0;
|
|
14774
14932
|
for (let i = 0, len = lines.length; i < len; i++) {
|
|
14775
14933
|
if (i === lineCountLimit - 1) {
|
|
14776
|
-
const clip =
|
|
14934
|
+
const clip = textMeasure.clipTextWithSuffix(lines[i], textOptions, maxLineWidth, ellipsis, !1, suffixPosition),
|
|
14935
|
+
matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);
|
|
14777
14936
|
linesLayout.push({
|
|
14778
14937
|
str: clip.str,
|
|
14779
|
-
width: clip.width
|
|
14938
|
+
width: clip.width,
|
|
14939
|
+
ascent: matrics.ascent,
|
|
14940
|
+
descent: matrics.descent
|
|
14780
14941
|
}), lineWidth = Math.max(lineWidth, clip.width);
|
|
14781
14942
|
break;
|
|
14782
14943
|
}
|
|
14783
|
-
text = lines[i], width =
|
|
14944
|
+
text = lines[i], width = textMeasure.measureTextWidth(text, textOptions), lineWidth = Math.max(lineWidth, width);
|
|
14945
|
+
const matrics = textMeasure.measureTextPixelADscentAndWidth(text, textOptions, measureMode);
|
|
14946
|
+
linesLayout.push({
|
|
14784
14947
|
str: text,
|
|
14785
|
-
width: width
|
|
14948
|
+
width: width,
|
|
14949
|
+
ascent: matrics.ascent,
|
|
14950
|
+
descent: matrics.descent
|
|
14786
14951
|
});
|
|
14787
14952
|
}
|
|
14788
14953
|
bboxWH[0] = lineWidth;
|
|
14789
14954
|
}
|
|
14790
|
-
bboxWH[1] = linesLayout.length *
|
|
14955
|
+
bboxWH[1] = linesLayout.length * lineHeight;
|
|
14791
14956
|
const bbox = {
|
|
14792
14957
|
xOffset: 0,
|
|
14793
14958
|
yOffset: 0,
|
|
@@ -14798,210 +14963,12 @@ class Text extends Graphic {
|
|
|
14798
14963
|
const layoutData = layoutObj.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline, lineHeight);
|
|
14799
14964
|
return this.cache.layoutData = layoutData, this.clearUpdateShapeTag(), this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
14800
14965
|
}
|
|
14801
|
-
updateSingallineAABBBounds(text) {
|
|
14802
|
-
const textTheme = this.getGraphicTheme(),
|
|
14803
|
-
{
|
|
14804
|
-
direction = textTheme.direction,
|
|
14805
|
-
underlineOffset = textTheme.underlineOffset
|
|
14806
|
-
} = this.attribute,
|
|
14807
|
-
b = "horizontal" === direction ? this.updateHorizontalSinglelineAABBBounds(text) : this.updateVerticalSinglelineAABBBounds(text);
|
|
14808
|
-
return "horizontal" === direction && underlineOffset && this._AABBBounds.add(this._AABBBounds.x1, this._AABBBounds.y2 + underlineOffset), b;
|
|
14809
|
-
}
|
|
14810
|
-
updateMultilineAABBBounds(text) {
|
|
14811
|
-
const textTheme = this.getGraphicTheme(),
|
|
14812
|
-
{
|
|
14813
|
-
direction = textTheme.direction,
|
|
14814
|
-
underlineOffset = textTheme.underlineOffset
|
|
14815
|
-
} = this.attribute,
|
|
14816
|
-
b = "horizontal" === direction ? this.updateHorizontalMultilineAABBBounds(text) : this.updateVerticalMultilineAABBBounds(text);
|
|
14817
|
-
return "horizontal" === direction && underlineOffset && this._AABBBounds.add(this._AABBBounds.x1, this._AABBBounds.y2 + underlineOffset), b;
|
|
14818
|
-
}
|
|
14819
|
-
updateHorizontalSinglelineAABBBounds(text) {
|
|
14820
|
-
var _a, _b;
|
|
14821
|
-
const textTheme = this.getGraphicTheme(),
|
|
14822
|
-
{
|
|
14823
|
-
wrap = textTheme.wrap
|
|
14824
|
-
} = this.attribute;
|
|
14825
|
-
if (wrap) return this.updateWrapAABBBounds([text]);
|
|
14826
|
-
const textMeasure = application.graphicUtil.textMeasure;
|
|
14827
|
-
let width, str;
|
|
14828
|
-
const attribute = this.attribute,
|
|
14829
|
-
{
|
|
14830
|
-
maxLineWidth = textTheme.maxLineWidth,
|
|
14831
|
-
ellipsis = textTheme.ellipsis,
|
|
14832
|
-
textAlign = textTheme.textAlign,
|
|
14833
|
-
textBaseline = textTheme.textBaseline,
|
|
14834
|
-
fontFamily = textTheme.fontFamily,
|
|
14835
|
-
fontSize = textTheme.fontSize,
|
|
14836
|
-
fontWeight = textTheme.fontWeight,
|
|
14837
|
-
stroke = textTheme.stroke,
|
|
14838
|
-
lineWidth = textTheme.lineWidth,
|
|
14839
|
-
ignoreBuf = textTheme.ignoreBuf,
|
|
14840
|
-
whiteSpace = textTheme.whiteSpace,
|
|
14841
|
-
suffixPosition = textTheme.suffixPosition
|
|
14842
|
-
} = attribute;
|
|
14843
|
-
if ("normal" === whiteSpace) return this.updateWrapAABBBounds(text);
|
|
14844
|
-
const buf = ignoreBuf ? 0 : Math.max(2, .075 * fontSize),
|
|
14845
|
-
textFontSize = attribute.fontSize || textTheme.fontSize,
|
|
14846
|
-
lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, textFontSize)) && void 0 !== _a ? _a : textFontSize + buf;
|
|
14847
|
-
if (!this.shouldUpdateShape() && this.cache) {
|
|
14848
|
-
width = null !== (_b = this.cache.clipedWidth) && void 0 !== _b ? _b : 0;
|
|
14849
|
-
const dx = textDrawOffsetX(textAlign, width),
|
|
14850
|
-
dy = textLayoutOffsetY(textBaseline, lineHeight, fontSize);
|
|
14851
|
-
return this._AABBBounds.set(dx, dy, dx + width, dy + lineHeight), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
14852
|
-
}
|
|
14853
|
-
if (Number.isFinite(maxLineWidth)) {
|
|
14854
|
-
if (ellipsis) {
|
|
14855
|
-
const strEllipsis = !0 === ellipsis ? textTheme.ellipsis : ellipsis,
|
|
14856
|
-
data = textMeasure.clipTextWithSuffix(text.toString(), {
|
|
14857
|
-
fontSize: fontSize,
|
|
14858
|
-
fontWeight: fontWeight,
|
|
14859
|
-
fontFamily: fontFamily
|
|
14860
|
-
}, maxLineWidth, strEllipsis, !1, suffixPosition);
|
|
14861
|
-
str = data.str, width = data.width;
|
|
14862
|
-
} else {
|
|
14863
|
-
const data = textMeasure.clipText(text.toString(), {
|
|
14864
|
-
fontSize: fontSize,
|
|
14865
|
-
fontWeight: fontWeight,
|
|
14866
|
-
fontFamily: fontFamily
|
|
14867
|
-
}, maxLineWidth, !1);
|
|
14868
|
-
str = data.str, width = data.width;
|
|
14869
|
-
}
|
|
14870
|
-
this.cache.clipedText = str, this.cache.clipedWidth = width;
|
|
14871
|
-
} else width = textMeasure.measureTextWidth(text.toString(), {
|
|
14872
|
-
fontSize: fontSize,
|
|
14873
|
-
fontWeight: fontWeight,
|
|
14874
|
-
fontFamily: fontFamily
|
|
14875
|
-
}), this.cache.clipedText = text.toString(), this.cache.clipedWidth = width;
|
|
14876
|
-
this.clearUpdateShapeTag();
|
|
14877
|
-
const dx = textDrawOffsetX(textAlign, width);
|
|
14878
|
-
let lh = lineHeight;
|
|
14879
|
-
application.global && application.global.isSafari() && (lh += .2 * fontSize);
|
|
14880
|
-
const dy = textLayoutOffsetY(textBaseline, lh, fontSize, buf);
|
|
14881
|
-
return this._AABBBounds.set(dx, dy, dx + width, dy + lh), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
14882
|
-
}
|
|
14883
|
-
getBaselineMapAlign() {
|
|
14884
|
-
return Text.baselineMapAlign;
|
|
14885
|
-
}
|
|
14886
|
-
getAlignMapBaseline() {
|
|
14887
|
-
return Text.alignMapBaseline;
|
|
14888
|
-
}
|
|
14889
|
-
updateVerticalSinglelineAABBBounds(text) {
|
|
14890
|
-
var _a, _b, _c;
|
|
14891
|
-
const textTheme = this.getGraphicTheme(),
|
|
14892
|
-
textMeasure = application.graphicUtil.textMeasure;
|
|
14893
|
-
let width;
|
|
14894
|
-
const attribute = this.attribute,
|
|
14895
|
-
{
|
|
14896
|
-
ignoreBuf = textTheme.ignoreBuf
|
|
14897
|
-
} = attribute,
|
|
14898
|
-
buf = ignoreBuf ? 0 : 2,
|
|
14899
|
-
{
|
|
14900
|
-
maxLineWidth = textTheme.maxLineWidth,
|
|
14901
|
-
ellipsis = textTheme.ellipsis,
|
|
14902
|
-
fontSize = textTheme.fontSize,
|
|
14903
|
-
fontWeight = textTheme.fontWeight,
|
|
14904
|
-
fontFamily = textTheme.fontFamily,
|
|
14905
|
-
stroke = textTheme.stroke,
|
|
14906
|
-
lineWidth = textTheme.lineWidth,
|
|
14907
|
-
verticalMode = textTheme.verticalMode,
|
|
14908
|
-
suffixPosition = textTheme.suffixPosition
|
|
14909
|
-
} = attribute,
|
|
14910
|
-
lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
|
|
14911
|
-
let {
|
|
14912
|
-
textAlign = textTheme.textAlign,
|
|
14913
|
-
textBaseline = textTheme.textBaseline
|
|
14914
|
-
} = attribute;
|
|
14915
|
-
if (!verticalMode) {
|
|
14916
|
-
const t = textAlign;
|
|
14917
|
-
textAlign = null !== (_b = Text.baselineMapAlign[textBaseline]) && void 0 !== _b ? _b : "left", textBaseline = null !== (_c = Text.alignMapBaseline[t]) && void 0 !== _c ? _c : "top";
|
|
14918
|
-
}
|
|
14919
|
-
if (!this.shouldUpdateShape() && this.cache) {
|
|
14920
|
-
width = this.cache.clipedWidth;
|
|
14921
|
-
const dx = textDrawOffsetX(textAlign, width),
|
|
14922
|
-
dy = textLayoutOffsetY(textBaseline, lineHeight, fontSize);
|
|
14923
|
-
return this._AABBBounds.set(dy, dx, dy + lineHeight, dx + width), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
14924
|
-
}
|
|
14925
|
-
let verticalList = [verticalLayout(text.toString())];
|
|
14926
|
-
if (Number.isFinite(maxLineWidth)) {
|
|
14927
|
-
if (ellipsis) {
|
|
14928
|
-
const strEllipsis = !0 === ellipsis ? textTheme.ellipsis : ellipsis,
|
|
14929
|
-
data = textMeasure.clipTextWithSuffixVertical(verticalList[0], {
|
|
14930
|
-
fontSize: fontSize,
|
|
14931
|
-
fontWeight: fontWeight,
|
|
14932
|
-
fontFamily: fontFamily
|
|
14933
|
-
}, maxLineWidth, strEllipsis, !1, suffixPosition);
|
|
14934
|
-
verticalList = [data.verticalList], width = data.width;
|
|
14935
|
-
} else {
|
|
14936
|
-
const data = textMeasure.clipTextVertical(verticalList[0], {
|
|
14937
|
-
fontSize: fontSize,
|
|
14938
|
-
fontWeight: fontWeight,
|
|
14939
|
-
fontFamily: fontFamily
|
|
14940
|
-
}, maxLineWidth, !1);
|
|
14941
|
-
verticalList = [data.verticalList], width = data.width;
|
|
14942
|
-
}
|
|
14943
|
-
this.cache.verticalList = verticalList, this.cache.clipedWidth = width;
|
|
14944
|
-
} else width = 0, verticalList[0].forEach(t => {
|
|
14945
|
-
const w = t.direction === TextDirection.HORIZONTAL ? fontSize : textMeasure.measureTextWidth(t.text, {
|
|
14946
|
-
fontSize: fontSize,
|
|
14947
|
-
fontWeight: fontWeight,
|
|
14948
|
-
fontFamily: fontFamily
|
|
14949
|
-
});
|
|
14950
|
-
width += w, t.width = w;
|
|
14951
|
-
}), this.cache.verticalList = verticalList, this.cache.clipedWidth = width;
|
|
14952
|
-
this.clearUpdateShapeTag();
|
|
14953
|
-
const dx = textDrawOffsetX(textAlign, width),
|
|
14954
|
-
dy = textLayoutOffsetY(textBaseline, lineHeight, fontSize);
|
|
14955
|
-
return this._AABBBounds.set(dy, dx, dy + lineHeight, dx + width), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
14956
|
-
}
|
|
14957
|
-
updateHorizontalMultilineAABBBounds(text) {
|
|
14958
|
-
var _a, _b;
|
|
14959
|
-
const textTheme = this.getGraphicTheme(),
|
|
14960
|
-
{
|
|
14961
|
-
wrap = textTheme.wrap
|
|
14962
|
-
} = this.attribute;
|
|
14963
|
-
if (wrap) return this.updateWrapAABBBounds(text);
|
|
14964
|
-
const attribute = this.attribute,
|
|
14965
|
-
{
|
|
14966
|
-
fontFamily = textTheme.fontFamily,
|
|
14967
|
-
textAlign = textTheme.textAlign,
|
|
14968
|
-
textBaseline = textTheme.textBaseline,
|
|
14969
|
-
fontSize = textTheme.fontSize,
|
|
14970
|
-
fontWeight = textTheme.fontWeight,
|
|
14971
|
-
ellipsis = textTheme.ellipsis,
|
|
14972
|
-
maxLineWidth: maxLineWidth,
|
|
14973
|
-
stroke = textTheme.stroke,
|
|
14974
|
-
lineWidth = textTheme.lineWidth,
|
|
14975
|
-
whiteSpace = textTheme.whiteSpace,
|
|
14976
|
-
suffixPosition = textTheme.suffixPosition
|
|
14977
|
-
} = attribute,
|
|
14978
|
-
lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : attribute.fontSize || textTheme.fontSize;
|
|
14979
|
-
if ("normal" === whiteSpace) return this.updateWrapAABBBounds(text);
|
|
14980
|
-
if (!this.shouldUpdateShape() && (null === (_b = this.cache) || void 0 === _b ? void 0 : _b.layoutData)) {
|
|
14981
|
-
const bbox = this.cache.layoutData.bbox;
|
|
14982
|
-
return this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
14983
|
-
}
|
|
14984
|
-
const textMeasure = application.graphicUtil.textMeasure,
|
|
14985
|
-
layoutData = new CanvasTextLayout(fontFamily, {
|
|
14986
|
-
fontSize: fontSize,
|
|
14987
|
-
fontWeight: fontWeight,
|
|
14988
|
-
fontFamily: fontFamily
|
|
14989
|
-
}, textMeasure).GetLayoutByLines(text, textAlign, textBaseline, lineHeight, !0 === ellipsis ? textTheme.ellipsis : ellipsis || void 0, !1, maxLineWidth, suffixPosition),
|
|
14990
|
-
{
|
|
14991
|
-
bbox: bbox
|
|
14992
|
-
} = layoutData;
|
|
14993
|
-
return this.cache.layoutData = layoutData, this.clearUpdateShapeTag(), this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
14994
|
-
}
|
|
14995
14966
|
updateVerticalMultilineAABBBounds(text) {
|
|
14996
|
-
var _a, _b
|
|
14967
|
+
var _a, _b;
|
|
14997
14968
|
const textTheme = this.getGraphicTheme(),
|
|
14998
14969
|
textMeasure = application.graphicUtil.textMeasure;
|
|
14999
14970
|
let width;
|
|
15000
14971
|
const attribute = this.attribute,
|
|
15001
|
-
{
|
|
15002
|
-
ignoreBuf = textTheme.ignoreBuf
|
|
15003
|
-
} = attribute,
|
|
15004
|
-
buf = ignoreBuf ? 0 : 2,
|
|
15005
14972
|
{
|
|
15006
14973
|
maxLineWidth = textTheme.maxLineWidth,
|
|
15007
14974
|
ellipsis = textTheme.ellipsis,
|
|
@@ -15013,14 +14980,14 @@ class Text extends Graphic {
|
|
|
15013
14980
|
verticalMode = textTheme.verticalMode,
|
|
15014
14981
|
suffixPosition = textTheme.suffixPosition
|
|
15015
14982
|
} = attribute,
|
|
15016
|
-
lineHeight =
|
|
14983
|
+
lineHeight = this.getLineHeight(attribute, textTheme);
|
|
15017
14984
|
let {
|
|
15018
14985
|
textAlign = textTheme.textAlign,
|
|
15019
14986
|
textBaseline = textTheme.textBaseline
|
|
15020
14987
|
} = attribute;
|
|
15021
14988
|
if (!verticalMode) {
|
|
15022
14989
|
const t = textAlign;
|
|
15023
|
-
textAlign = null !== (
|
|
14990
|
+
textAlign = null !== (_a = Text.baselineMapAlign[textBaseline]) && void 0 !== _a ? _a : "left", textBaseline = null !== (_b = Text.alignMapBaseline[t]) && void 0 !== _b ? _b : "top";
|
|
15024
14991
|
}
|
|
15025
14992
|
if (width = 0, !this.shouldUpdateShape() && this.cache) {
|
|
15026
14993
|
this.cache.verticalList.forEach(item => {
|
|
@@ -15068,6 +15035,15 @@ class Text extends Graphic {
|
|
|
15068
15035
|
dy = textLayoutOffsetY(textBaseline, height, fontSize);
|
|
15069
15036
|
return this._AABBBounds.set(dy, dx, dy + height, dx + width), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
15070
15037
|
}
|
|
15038
|
+
getMaxWidth(theme) {
|
|
15039
|
+
var _a, _b;
|
|
15040
|
+
const attribute = this.attribute;
|
|
15041
|
+
return null !== (_b = null !== (_a = attribute.maxLineWidth) && void 0 !== _a ? _a : attribute.maxWidth) && void 0 !== _b ? _b : theme.maxWidth;
|
|
15042
|
+
}
|
|
15043
|
+
getLineHeight(attribute, textTheme) {
|
|
15044
|
+
var _a;
|
|
15045
|
+
return null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : attribute.fontSize || textTheme.fontSize;
|
|
15046
|
+
}
|
|
15071
15047
|
needUpdateTags(keys) {
|
|
15072
15048
|
let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TEXT_UPDATE_TAG_KEY;
|
|
15073
15049
|
return super.needUpdateTags(keys, k);
|
|
@@ -15082,6 +15058,12 @@ class Text extends Graphic {
|
|
|
15082
15058
|
getNoWorkAnimateAttr() {
|
|
15083
15059
|
return Text.NOWORK_ANIMATE_ATTR;
|
|
15084
15060
|
}
|
|
15061
|
+
getBaselineMapAlign() {
|
|
15062
|
+
return Text.baselineMapAlign;
|
|
15063
|
+
}
|
|
15064
|
+
getAlignMapBaseline() {
|
|
15065
|
+
return Text.alignMapBaseline;
|
|
15066
|
+
}
|
|
15085
15067
|
}
|
|
15086
15068
|
Text.NOWORK_ANIMATE_ATTR = Object.assign({
|
|
15087
15069
|
ellipsis: 1,
|
|
@@ -15160,7 +15142,9 @@ class WrapText extends Text {
|
|
|
15160
15142
|
const clip = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1, suffixPosition);
|
|
15161
15143
|
linesLayout.push({
|
|
15162
15144
|
str: clip.str,
|
|
15163
|
-
width: clip.width
|
|
15145
|
+
width: clip.width,
|
|
15146
|
+
ascent: 0,
|
|
15147
|
+
descent: 0
|
|
15164
15148
|
});
|
|
15165
15149
|
break;
|
|
15166
15150
|
}
|
|
@@ -15174,7 +15158,9 @@ class WrapText extends Text {
|
|
|
15174
15158
|
}
|
|
15175
15159
|
if (linesLayout.push({
|
|
15176
15160
|
str: clip.str,
|
|
15177
|
-
width: clip.width
|
|
15161
|
+
width: clip.width,
|
|
15162
|
+
ascent: 0,
|
|
15163
|
+
descent: 0
|
|
15178
15164
|
}), clip.str.length === str.length) ;else if (needCut) {
|
|
15179
15165
|
const newStr = str.substring(clip.str.length);
|
|
15180
15166
|
lines.splice(i + 1, 0, newStr);
|
|
@@ -15193,13 +15179,17 @@ class WrapText extends Text {
|
|
|
15193
15179
|
const clip = layoutObj.textMeasure.clipTextWithSuffix(lines[i], layoutObj.textOptions, maxLineWidth, ellipsis, !1, suffixPosition);
|
|
15194
15180
|
linesLayout.push({
|
|
15195
15181
|
str: clip.str,
|
|
15196
|
-
width: clip.width
|
|
15182
|
+
width: clip.width,
|
|
15183
|
+
ascent: 0,
|
|
15184
|
+
descent: 0
|
|
15197
15185
|
}), lineWidth = Math.max(lineWidth, clip.width);
|
|
15198
15186
|
break;
|
|
15199
15187
|
}
|
|
15200
15188
|
text = lines[i], width = layoutObj.textMeasure.measureTextWidth(text, layoutObj.textOptions, "break-word" === wordBreak), lineWidth = Math.max(lineWidth, width), linesLayout.push({
|
|
15201
15189
|
str: text,
|
|
15202
|
-
width: width
|
|
15190
|
+
width: width,
|
|
15191
|
+
ascent: 0,
|
|
15192
|
+
descent: 0
|
|
15203
15193
|
});
|
|
15204
15194
|
}
|
|
15205
15195
|
bboxWH[0] = lineWidth;
|
|
@@ -15243,6 +15233,9 @@ class BaseSymbol {
|
|
|
15243
15233
|
bounds.x1 = -halfS, bounds.x2 = halfS, bounds.y1 = -halfS, bounds.y2 = halfS;
|
|
15244
15234
|
} else bounds.x1 = -size[0] / 2, bounds.x2 = size[0] / 2, bounds.y1 = -size[1] / 2, bounds.y2 = size[1] / 2;
|
|
15245
15235
|
}
|
|
15236
|
+
parseSize(size) {
|
|
15237
|
+
return isNumber$1(size) ? size : Math.min(size[0], size[1]);
|
|
15238
|
+
}
|
|
15246
15239
|
}
|
|
15247
15240
|
|
|
15248
15241
|
function circle(ctx, r, x, y, z) {
|
|
@@ -15253,13 +15246,13 @@ class CircleSymbol extends BaseSymbol {
|
|
|
15253
15246
|
super(...arguments), this.type = "circle", this.pathStr = "M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0";
|
|
15254
15247
|
}
|
|
15255
15248
|
draw(ctx, size, x, y, z) {
|
|
15256
|
-
return circle(ctx, size / 2, x, y, z);
|
|
15249
|
+
return circle(ctx, this.parseSize(size) / 2, x, y, z);
|
|
15257
15250
|
}
|
|
15258
15251
|
drawOffset(ctx, size, x, y, offset, z) {
|
|
15259
|
-
return circle(ctx, size / 2 + offset, x, y, z);
|
|
15252
|
+
return circle(ctx, this.parseSize(size) / 2 + offset, x, y, z);
|
|
15260
15253
|
}
|
|
15261
15254
|
drawToSvgPath(size, x, y, z) {
|
|
15262
|
-
const r = size / 2;
|
|
15255
|
+
const r = this.parseSize(size) / 2;
|
|
15263
15256
|
return `M ${x - r}, ${y} a ${r},${r} 0 1,0 ${2 * r},0 a ${r},${r} 0 1,0 -${2 * r},0`;
|
|
15264
15257
|
}
|
|
15265
15258
|
}
|
|
@@ -15276,10 +15269,10 @@ class CrossSymbol extends BaseSymbol {
|
|
|
15276
15269
|
super(...arguments), this.type = "cross", 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";
|
|
15277
15270
|
}
|
|
15278
15271
|
draw(ctx, size, x, y, z) {
|
|
15279
|
-
return cross(ctx, size / 6, x, y, z);
|
|
15272
|
+
return cross(ctx, this.parseSize(size) / 6, x, y, z);
|
|
15280
15273
|
}
|
|
15281
15274
|
drawOffset(ctx, size, x, y, offset, z) {
|
|
15282
|
-
return crossOffset(ctx, size / 6, x, y, offset, z);
|
|
15275
|
+
return crossOffset(ctx, this.parseSize(size) / 6, x, y, offset, z);
|
|
15283
15276
|
}
|
|
15284
15277
|
}
|
|
15285
15278
|
var cross$1 = new CrossSymbol();
|
|
@@ -15292,13 +15285,13 @@ class DiamondSymbol extends BaseSymbol {
|
|
|
15292
15285
|
super(...arguments), this.type = "diamond", this.pathStr = "M-0.5,0L0,-0.5L0.5,0L0,0.5Z";
|
|
15293
15286
|
}
|
|
15294
15287
|
draw(ctx, size, x, y, z) {
|
|
15295
|
-
return diamond(ctx, size / 2, x, y, z);
|
|
15288
|
+
return diamond(ctx, this.parseSize(size) / 2, x, y, z);
|
|
15296
15289
|
}
|
|
15297
15290
|
drawFitDir(ctx, size, x, y, z) {
|
|
15298
|
-
return diamond(ctx, size / 2, x, y, z);
|
|
15291
|
+
return diamond(ctx, this.parseSize(size) / 2, x, y, z);
|
|
15299
15292
|
}
|
|
15300
15293
|
drawOffset(ctx, size, x, y, offset, z) {
|
|
15301
|
-
return diamond(ctx, size / 2 + offset, x, y, z);
|
|
15294
|
+
return diamond(ctx, this.parseSize(size) / 2 + offset, x, y, z);
|
|
15302
15295
|
}
|
|
15303
15296
|
}
|
|
15304
15297
|
var diamond$1 = new DiamondSymbol();
|
|
@@ -15312,10 +15305,10 @@ class SquareSymbol extends BaseSymbol {
|
|
|
15312
15305
|
super(...arguments), this.type = "square", this.pathStr = "M-0.5,-0.5h1v1h-1Z";
|
|
15313
15306
|
}
|
|
15314
15307
|
draw(ctx, size, x, y) {
|
|
15315
|
-
return square(ctx, size / 2, x, y);
|
|
15308
|
+
return square(ctx, this.parseSize(size) / 2, x, y);
|
|
15316
15309
|
}
|
|
15317
15310
|
drawOffset(ctx, size, x, y, offset) {
|
|
15318
|
-
return square(ctx, size / 2 + offset, x, y);
|
|
15311
|
+
return square(ctx, this.parseSize(size) / 2 + offset, x, y);
|
|
15319
15312
|
}
|
|
15320
15313
|
}
|
|
15321
15314
|
var square$1 = new SquareSymbol();
|
|
@@ -15329,10 +15322,10 @@ class TriangleUpSymbol extends BaseSymbol {
|
|
|
15329
15322
|
super(...arguments), this.type = "triangleUp", this.pathStr = "M0.5,0.5 L-0.5,0.5 L0,-0.5 Z";
|
|
15330
15323
|
}
|
|
15331
15324
|
draw(ctx, size, x, y) {
|
|
15332
|
-
return trianglUpOffset(ctx, size / 2, x, y);
|
|
15325
|
+
return trianglUpOffset(ctx, this.parseSize(size) / 2, x, y);
|
|
15333
15326
|
}
|
|
15334
15327
|
drawOffset(ctx, size, x, y, offset) {
|
|
15335
|
-
return trianglUpOffset(ctx, size / 2, x, y, offset);
|
|
15328
|
+
return trianglUpOffset(ctx, this.parseSize(size) / 2, x, y, offset);
|
|
15336
15329
|
}
|
|
15337
15330
|
}
|
|
15338
15331
|
var triangleUp = new TriangleUpSymbol();
|
|
@@ -15364,10 +15357,10 @@ class StarSymbol extends BaseSymbol {
|
|
|
15364
15357
|
super(...arguments), this.type = "star", 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";
|
|
15365
15358
|
}
|
|
15366
15359
|
draw(ctx, size, transX, transY) {
|
|
15367
|
-
return star(ctx, size / 2, transX, transY);
|
|
15360
|
+
return star(ctx, this.parseSize(size) / 2, transX, transY);
|
|
15368
15361
|
}
|
|
15369
15362
|
drawOffset(ctx, size, transX, transY, offset) {
|
|
15370
|
-
return star(ctx, size / 2 + offset, transX, transY);
|
|
15363
|
+
return star(ctx, this.parseSize(size) / 2 + offset, transX, transY);
|
|
15371
15364
|
}
|
|
15372
15365
|
}
|
|
15373
15366
|
var star$1 = new StarSymbol();
|
|
@@ -15385,10 +15378,10 @@ class ArrowSymbol extends BaseSymbol {
|
|
|
15385
15378
|
super(...arguments), this.type = "arrow", 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";
|
|
15386
15379
|
}
|
|
15387
15380
|
draw(ctx, size, transX, transY) {
|
|
15388
|
-
return arrow(ctx, size / 2, transX, transY);
|
|
15381
|
+
return arrow(ctx, this.parseSize(size) / 2, transX, transY);
|
|
15389
15382
|
}
|
|
15390
15383
|
drawOffset(ctx, size, transX, transY, offset) {
|
|
15391
|
-
return arrow(ctx, size / 2 + offset, transX, transY);
|
|
15384
|
+
return arrow(ctx, this.parseSize(size) / 2 + offset, transX, transY);
|
|
15392
15385
|
}
|
|
15393
15386
|
}
|
|
15394
15387
|
var arrow$1 = new ArrowSymbol();
|
|
@@ -15402,10 +15395,10 @@ class WedgeSymbol extends BaseSymbol {
|
|
|
15402
15395
|
super(...arguments), this.type = "wedge", this.pathStr = "M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z";
|
|
15403
15396
|
}
|
|
15404
15397
|
draw(ctx, size, transX, transY) {
|
|
15405
|
-
return wedge(ctx, size / 2, transX, transY);
|
|
15398
|
+
return wedge(ctx, this.parseSize(size) / 2, transX, transY);
|
|
15406
15399
|
}
|
|
15407
15400
|
drawOffset(ctx, size, transX, transY, offset) {
|
|
15408
|
-
return wedge(ctx, size / 2 + offset, transX, transY);
|
|
15401
|
+
return wedge(ctx, this.parseSize(size) / 2 + offset, transX, transY);
|
|
15409
15402
|
}
|
|
15410
15403
|
}
|
|
15411
15404
|
var wedge$1 = new WedgeSymbol();
|
|
@@ -15418,10 +15411,10 @@ class StrokeSymbol extends BaseSymbol {
|
|
|
15418
15411
|
super(...arguments), this.type = "stroke", this.pathStr = "";
|
|
15419
15412
|
}
|
|
15420
15413
|
draw(ctx, size, transX, transY) {
|
|
15421
|
-
return stroke(ctx, size / 2, transX, transY);
|
|
15414
|
+
return stroke(ctx, this.parseSize(size) / 2, transX, transY);
|
|
15422
15415
|
}
|
|
15423
15416
|
drawOffset(ctx, size, transX, transY, offset) {
|
|
15424
|
-
return stroke(ctx, size / 2 + offset, transX, transY);
|
|
15417
|
+
return stroke(ctx, this.parseSize(size) / 2 + offset, transX, transY);
|
|
15425
15418
|
}
|
|
15426
15419
|
}
|
|
15427
15420
|
var stroke$1 = new StrokeSymbol();
|
|
@@ -15443,10 +15436,10 @@ class WyeSymbol extends BaseSymbol {
|
|
|
15443
15436
|
super(...arguments), this.type = "wye", 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";
|
|
15444
15437
|
}
|
|
15445
15438
|
draw(ctx, size, transX, transY) {
|
|
15446
|
-
return wye(ctx, size / 2, transX, transY);
|
|
15439
|
+
return wye(ctx, this.parseSize(size) / 2, transX, transY);
|
|
15447
15440
|
}
|
|
15448
15441
|
drawOffset(ctx, size, transX, transY, offset) {
|
|
15449
|
-
return wye(ctx, size / 2 + offset, transX, transY);
|
|
15442
|
+
return wye(ctx, this.parseSize(size) / 2 + offset, transX, transY);
|
|
15450
15443
|
}
|
|
15451
15444
|
}
|
|
15452
15445
|
var wye$1 = new WyeSymbol();
|
|
@@ -15459,10 +15452,10 @@ class TriangleLeftSymbol extends BaseSymbol {
|
|
|
15459
15452
|
super(...arguments), this.type = "triangleLeft", this.pathStr = "M-0.5,0 L0.5,0.5 L0.5,-0.5 Z";
|
|
15460
15453
|
}
|
|
15461
15454
|
draw(ctx, size, x, y) {
|
|
15462
|
-
return trianglLeftOffset(ctx, size / 2, x, y, 0);
|
|
15455
|
+
return trianglLeftOffset(ctx, this.parseSize(size) / 2, x, y, 0);
|
|
15463
15456
|
}
|
|
15464
15457
|
drawOffset(ctx, size, x, y, offset) {
|
|
15465
|
-
return trianglLeftOffset(ctx, size / 2, x, y, offset);
|
|
15458
|
+
return trianglLeftOffset(ctx, this.parseSize(size) / 2, x, y, offset);
|
|
15466
15459
|
}
|
|
15467
15460
|
}
|
|
15468
15461
|
var triangleLeft = new TriangleLeftSymbol();
|
|
@@ -15476,10 +15469,10 @@ class TriangleRightSymbol extends BaseSymbol {
|
|
|
15476
15469
|
super(...arguments), this.type = "triangleRight", this.pathStr = "M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z";
|
|
15477
15470
|
}
|
|
15478
15471
|
draw(ctx, size, x, y) {
|
|
15479
|
-
return trianglRightOffset(ctx, size / 2, x, y);
|
|
15472
|
+
return trianglRightOffset(ctx, this.parseSize(size) / 2, x, y);
|
|
15480
15473
|
}
|
|
15481
15474
|
drawOffset(ctx, size, x, y, offset) {
|
|
15482
|
-
return trianglRightOffset(ctx, size / 2, x, y, offset);
|
|
15475
|
+
return trianglRightOffset(ctx, this.parseSize(size) / 2, x, y, offset);
|
|
15483
15476
|
}
|
|
15484
15477
|
}
|
|
15485
15478
|
var triangleRight = new TriangleRightSymbol();
|
|
@@ -15493,10 +15486,10 @@ class TriangleDownSymbol extends BaseSymbol {
|
|
|
15493
15486
|
super(...arguments), this.type = "triangleDown", this.pathStr = "M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z";
|
|
15494
15487
|
}
|
|
15495
15488
|
draw(ctx, size, x, y) {
|
|
15496
|
-
return trianglDownOffset(ctx, size / 2, x, y);
|
|
15489
|
+
return trianglDownOffset(ctx, this.parseSize(size) / 2, x, y);
|
|
15497
15490
|
}
|
|
15498
15491
|
drawOffset(ctx, size, x, y, offset) {
|
|
15499
|
-
return trianglDownOffset(ctx, size / 2, x, y, offset);
|
|
15492
|
+
return trianglDownOffset(ctx, this.parseSize(size) / 2, x, y, offset);
|
|
15500
15493
|
}
|
|
15501
15494
|
}
|
|
15502
15495
|
var triangleDown = new TriangleDownSymbol();
|
|
@@ -15511,10 +15504,10 @@ class ThinTriangleSymbol extends BaseSymbol {
|
|
|
15511
15504
|
super(...arguments), this.type = "thinTriangle", this.pathStr = "M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z";
|
|
15512
15505
|
}
|
|
15513
15506
|
draw(ctx, size, x, y) {
|
|
15514
|
-
return thinTriangle(ctx, size / 2 / sqrt3, x, y);
|
|
15507
|
+
return thinTriangle(ctx, this.parseSize(size) / 2 / sqrt3, x, y);
|
|
15515
15508
|
}
|
|
15516
15509
|
drawOffset(ctx, size, x, y, offset) {
|
|
15517
|
-
return thinTriangle(ctx, size / 2 / sqrt3 + offset, x, y);
|
|
15510
|
+
return thinTriangle(ctx, this.parseSize(size) / 2 / sqrt3 + offset, x, y);
|
|
15518
15511
|
}
|
|
15519
15512
|
}
|
|
15520
15513
|
var thinTriangle$1 = new ThinTriangleSymbol();
|
|
@@ -15528,10 +15521,10 @@ class Arrow2LeftSymbol extends BaseSymbol {
|
|
|
15528
15521
|
super(...arguments), this.type = "arrow2Left", this.pathStr = "M 0.25 -0.5 L -0.25 0 l 0.25 0.5";
|
|
15529
15522
|
}
|
|
15530
15523
|
draw(ctx, size, transX, transY) {
|
|
15531
|
-
return arrow2Left(ctx, size / 4, transX, transY);
|
|
15524
|
+
return arrow2Left(ctx, this.parseSize(size) / 4, transX, transY);
|
|
15532
15525
|
}
|
|
15533
15526
|
drawOffset(ctx, size, transX, transY, offset) {
|
|
15534
|
-
return arrow2Left(ctx, size / 4 + offset, transX, transY);
|
|
15527
|
+
return arrow2Left(ctx, this.parseSize(size) / 4 + offset, transX, transY);
|
|
15535
15528
|
}
|
|
15536
15529
|
}
|
|
15537
15530
|
var arrow2Left$1 = new Arrow2LeftSymbol();
|
|
@@ -15545,10 +15538,10 @@ class Arrow2RightSymbol extends BaseSymbol {
|
|
|
15545
15538
|
super(...arguments), this.type = "arrow2Right", this.pathStr = "M -0.25 -0.5 l 0.25 0 l -0.25 0.5";
|
|
15546
15539
|
}
|
|
15547
15540
|
draw(ctx, size, transX, transY) {
|
|
15548
|
-
return arrow2Right(ctx, size / 4, transX, transY);
|
|
15541
|
+
return arrow2Right(ctx, this.parseSize(size) / 4, transX, transY);
|
|
15549
15542
|
}
|
|
15550
15543
|
drawOffset(ctx, size, transX, transY, offset) {
|
|
15551
|
-
return arrow2Right(ctx, size / 4 + offset, transX, transY);
|
|
15544
|
+
return arrow2Right(ctx, this.parseSize(size) / 4 + offset, transX, transY);
|
|
15552
15545
|
}
|
|
15553
15546
|
}
|
|
15554
15547
|
var arrow2Right$1 = new Arrow2RightSymbol();
|
|
@@ -15562,10 +15555,10 @@ class Arrow2UpSymbol extends BaseSymbol {
|
|
|
15562
15555
|
super(...arguments), this.type = "arrow2Up", this.pathStr = "M -0.5 0.25 L 0 -0.25 l 0.5 0.25";
|
|
15563
15556
|
}
|
|
15564
15557
|
draw(ctx, size, transX, transY) {
|
|
15565
|
-
return arrow2Up(ctx, size / 4, transX, transY);
|
|
15558
|
+
return arrow2Up(ctx, this.parseSize(size) / 4, transX, transY);
|
|
15566
15559
|
}
|
|
15567
15560
|
drawOffset(ctx, size, transX, transY, offset) {
|
|
15568
|
-
return arrow2Up(ctx, size / 4 + offset, transX, transY);
|
|
15561
|
+
return arrow2Up(ctx, this.parseSize(size) / 4 + offset, transX, transY);
|
|
15569
15562
|
}
|
|
15570
15563
|
}
|
|
15571
15564
|
var arrow2Up$1 = new Arrow2UpSymbol();
|
|
@@ -15579,10 +15572,10 @@ class Arrow2DownSymbol extends BaseSymbol {
|
|
|
15579
15572
|
super(...arguments), this.type = "arrow2Down", this.pathStr = "M -0.5 -0.25 L 0 0.25 l 0.5 -0.25";
|
|
15580
15573
|
}
|
|
15581
15574
|
draw(ctx, size, transX, transY) {
|
|
15582
|
-
return arrow2Down(ctx, size / 4, transX, transY);
|
|
15575
|
+
return arrow2Down(ctx, this.parseSize(size) / 4, transX, transY);
|
|
15583
15576
|
}
|
|
15584
15577
|
drawOffset(ctx, size, transX, transY, offset) {
|
|
15585
|
-
return arrow2Down(ctx, size / 4 + offset, transX, transY);
|
|
15578
|
+
return arrow2Down(ctx, this.parseSize(size) / 4 + offset, transX, transY);
|
|
15586
15579
|
}
|
|
15587
15580
|
}
|
|
15588
15581
|
var arrow2Down$1 = new Arrow2DownSymbol();
|
|
@@ -15595,13 +15588,13 @@ class LineVSymbol extends BaseSymbol {
|
|
|
15595
15588
|
super(...arguments), this.type = "lineV", this.pathStr = "M0,-0.5L0,0.5";
|
|
15596
15589
|
}
|
|
15597
15590
|
draw(ctx, size, x, y, z) {
|
|
15598
|
-
return lineV(ctx, size / 2, x, y);
|
|
15591
|
+
return lineV(ctx, this.parseSize(size) / 2, x, y);
|
|
15599
15592
|
}
|
|
15600
15593
|
drawOffset(ctx, size, x, y, offset, z) {
|
|
15601
|
-
return lineV(ctx, size / 2 + offset, x, y);
|
|
15594
|
+
return lineV(ctx, this.parseSize(size) / 2 + offset, x, y);
|
|
15602
15595
|
}
|
|
15603
15596
|
drawToSvgPath(size, x, y, z) {
|
|
15604
|
-
const r = size / 2;
|
|
15597
|
+
const r = this.parseSize(size) / 2;
|
|
15605
15598
|
return `M ${x}, ${y - r} L ${x},${y + r}`;
|
|
15606
15599
|
}
|
|
15607
15600
|
}
|
|
@@ -15615,13 +15608,13 @@ class LineHSymbol extends BaseSymbol {
|
|
|
15615
15608
|
super(...arguments), this.type = "lineH", this.pathStr = "M-0.5,0L0.5,0";
|
|
15616
15609
|
}
|
|
15617
15610
|
draw(ctx, size, x, y, z) {
|
|
15618
|
-
return lineH(ctx, size / 2, x, y);
|
|
15611
|
+
return lineH(ctx, this.parseSize(size) / 2, x, y);
|
|
15619
15612
|
}
|
|
15620
15613
|
drawOffset(ctx, size, x, y, offset, z) {
|
|
15621
|
-
return lineH(ctx, size / 2 + offset, x, y);
|
|
15614
|
+
return lineH(ctx, this.parseSize(size) / 2 + offset, x, y);
|
|
15622
15615
|
}
|
|
15623
15616
|
drawToSvgPath(size, x, y, z) {
|
|
15624
|
-
const r = size / 2;
|
|
15617
|
+
const r = this.parseSize(size) / 2;
|
|
15625
15618
|
return `M ${x - r}, ${y} L ${x + r},${y}`;
|
|
15626
15619
|
}
|
|
15627
15620
|
}
|
|
@@ -15635,13 +15628,13 @@ class CloseSymbol extends BaseSymbol {
|
|
|
15635
15628
|
super(...arguments), this.type = "close", this.pathStr = "M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5";
|
|
15636
15629
|
}
|
|
15637
15630
|
draw(ctx, size, x, y, z) {
|
|
15638
|
-
return close(ctx, size / 2, x, y);
|
|
15631
|
+
return close(ctx, this.parseSize(size) / 2, x, y);
|
|
15639
15632
|
}
|
|
15640
15633
|
drawOffset(ctx, size, x, y, offset, z) {
|
|
15641
|
-
return close(ctx, size / 2 + offset, x, y);
|
|
15634
|
+
return close(ctx, this.parseSize(size) / 2 + offset, x, y);
|
|
15642
15635
|
}
|
|
15643
15636
|
drawToSvgPath(size, x, y, z) {
|
|
15644
|
-
const r = size / 2;
|
|
15637
|
+
const r = this.parseSize(size) / 2;
|
|
15645
15638
|
return `M ${x - r}, ${y - r} L ${x + r},${y + r} M ${x + r}, ${y - r} L ${x - r},${y + r}`;
|
|
15646
15639
|
}
|
|
15647
15640
|
}
|
|
@@ -15675,15 +15668,18 @@ class CustomSymbolClass {
|
|
|
15675
15668
|
this.pathStr = "", this.type = type, isArray$1(path) ? this.svgCache = path : this.path = path, this.isSvg = isSvg;
|
|
15676
15669
|
}
|
|
15677
15670
|
drawOffset(ctx, size, x, y, offset, z, cb) {
|
|
15678
|
-
return this.isSvg ? !!this.svgCache && (this.svgCache.forEach(item => {
|
|
15671
|
+
return size = this.parseSize(size), this.isSvg ? !!this.svgCache && (this.svgCache.forEach(item => {
|
|
15679
15672
|
ctx.beginPath(), renderCommandList(item.path.commandList, ctx, x, y, size, size), cb && cb(item.path, item.attribute);
|
|
15680
15673
|
}), !1) : (renderCommandList(this.path.commandList, ctx, x, y, size + offset, size + offset), !1);
|
|
15681
15674
|
}
|
|
15682
15675
|
draw(ctx, size, x, y, z, cb) {
|
|
15683
|
-
return this.drawOffset(ctx, size, x, y, 0, z, cb);
|
|
15676
|
+
return size = this.parseSize(size), this.drawOffset(ctx, size, x, y, 0, z, cb);
|
|
15677
|
+
}
|
|
15678
|
+
parseSize(size) {
|
|
15679
|
+
return isNumber$1(size) ? size : Math.min(size[0], size[1]);
|
|
15684
15680
|
}
|
|
15685
15681
|
bounds(size, bounds) {
|
|
15686
|
-
if (this.isSvg) {
|
|
15682
|
+
if (size = this.parseSize(size), this.isSvg) {
|
|
15687
15683
|
if (!this.svgCache) return;
|
|
15688
15684
|
return bounds.clear(), void this.svgCache.forEach(_ref => {
|
|
15689
15685
|
let {
|
|
@@ -16366,7 +16362,11 @@ class Paragraph {
|
|
|
16366
16362
|
case "sub":
|
|
16367
16363
|
baseline += this.descent / 2;
|
|
16368
16364
|
}
|
|
16369
|
-
"vertical" === direction && (ctx.save(), ctx.rotateAbout(Math.PI / 2, left, baseline), ctx.translate(-this.heightOrigin || -this.lineHeight / 2, -this.descent / 2), ctx.translate(left, baseline), left = 0, baseline = 0)
|
|
16365
|
+
"vertical" === direction && (ctx.save(), ctx.rotateAbout(Math.PI / 2, left, baseline), ctx.translate(-this.heightOrigin || -this.lineHeight / 2, -this.descent / 2), ctx.translate(left, baseline), left = 0, baseline = 0);
|
|
16366
|
+
const {
|
|
16367
|
+
lineWidth = 1
|
|
16368
|
+
} = this.character;
|
|
16369
|
+
this.character.stroke && lineWidth && (applyStrokeStyle(ctx, this.character), ctx.strokeText(text, left, baseline)), applyFillStyle(ctx, this.character), this.character.fill && ctx.fillText(text, left, baseline), this.character.fill && ("boolean" == typeof this.character.lineThrough || "boolean" == typeof this.character.underline ? (this.character.underline && ctx.fillRect(left, 1 + baseline, this.widthOrigin || this.width, this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1), this.character.lineThrough && ctx.fillRect(left, 1 + baseline - this.ascent / 2, this.widthOrigin || this.width, this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1)) : "underline" === this.character.textDecoration ? ctx.fillRect(left, 1 + baseline, this.widthOrigin || this.width, this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1) : "line-through" === this.character.textDecoration && ctx.fillRect(left, 1 + baseline - this.ascent / 2, this.widthOrigin || this.width, this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1)), "vertical" === direction && ctx.restore();
|
|
16370
16370
|
}
|
|
16371
16371
|
getWidthWithEllips(direction) {
|
|
16372
16372
|
let text = this.text;
|
|
@@ -18583,7 +18583,7 @@ class Stage extends Group {
|
|
|
18583
18583
|
constructor() {
|
|
18584
18584
|
let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
18585
18585
|
var _a;
|
|
18586
|
-
super({}), this._onVisibleChange = visible => {
|
|
18586
|
+
super({}), this.tickedBeforeRender = !0, this._onVisibleChange = visible => {
|
|
18587
18587
|
if (!(this._skipRender < 0)) if (visible) {
|
|
18588
18588
|
if (this.dirtyBounds) {
|
|
18589
18589
|
const b = this.window.getViewBox();
|
|
@@ -18594,7 +18594,10 @@ class Stage extends Group {
|
|
|
18594
18594
|
}, this.beforeRender = stage => {
|
|
18595
18595
|
this._beforeRender && this._beforeRender(stage);
|
|
18596
18596
|
}, this.afterRender = stage => {
|
|
18597
|
-
this.renderCount++, this._afterRender && this._afterRender(stage), this._afterNextRenderCbs && this._afterNextRenderCbs.forEach(cb => cb(stage)), this._afterNextRenderCbs = null;
|
|
18597
|
+
this.renderCount++, this._afterRender && this._afterRender(stage), this._afterNextRenderCbs && this._afterNextRenderCbs.forEach(cb => cb(stage)), this._afterNextRenderCbs = null, this.tickedBeforeRender = !1;
|
|
18598
|
+
}, this.afterTickCb = () => {
|
|
18599
|
+
var _a;
|
|
18600
|
+
this.tickedBeforeRender = !0, "performance" === (null === (_a = this.params.optimize) || void 0 === _a ? void 0 : _a.tickRenderMode) || "rendering" !== this.state && this.render();
|
|
18598
18601
|
}, this.params = params, this.theme = new Theme(), this.hooks = {
|
|
18599
18602
|
beforeRender: new SyncHook(["stage"]),
|
|
18600
18603
|
afterRender: new SyncHook(["stage"])
|
|
@@ -18611,7 +18614,7 @@ class Stage extends Group {
|
|
|
18611
18614
|
main: !0
|
|
18612
18615
|
})), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), params.autoRefresh && this.enableAutoRefresh(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.ReactDOM && this.enableReactAttribute(params.ReactDOM), params.enableLayout && this.enableLayout(), this.hooks.beforeRender.tap("constructor", this.beforeRender), this.hooks.afterRender.tap("constructor", this.afterRender), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this.ticker = params.ticker || defaultTicker, this.supportInteractiveLayer = !1 !== params.interactiveLayer, this.timeline = new DefaultTimeline(), this.ticker.addTimeline(this.timeline), this.timeline.pause(), params.optimize || (params.optimize = {}), this.optmize(params.optimize), params.background && isString$1(this._background) && this._background.includes("/") && this.setAttributes({
|
|
18613
18616
|
background: this._background
|
|
18614
|
-
});
|
|
18617
|
+
}), this.ticker.on("afterTick", this.afterTickCb);
|
|
18615
18618
|
}
|
|
18616
18619
|
pauseRender() {
|
|
18617
18620
|
let sr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
|
|
@@ -18840,7 +18843,7 @@ class Stage extends Group {
|
|
|
18840
18843
|
if ("released" === this.releaseStatus) return;
|
|
18841
18844
|
this.ticker.start(), this.timeline.resume();
|
|
18842
18845
|
const state = this.state;
|
|
18843
|
-
this.state = "rendering", this.layerService.prepareStageLayer(this), this._skipRender || (this.lastRenderparams = params, this.hooks.beforeRender.call(this), this._skipRender || (this.renderLayerList(this.children), this.combineLayersToWindow(), this.nextFrameRenderLayerSet.clear()), this.hooks.afterRender.call(this)), this.state = state, this._skipRender && this._skipRender++;
|
|
18846
|
+
this.state = "rendering", this.tickedBeforeRender || this.ticker.trySyncTickStatus(), this.layerService.prepareStageLayer(this), this._skipRender || (this.lastRenderparams = params, this.hooks.beforeRender.call(this), this._skipRender || (this.renderLayerList(this.children), this.combineLayersToWindow(), this.nextFrameRenderLayerSet.clear()), this.hooks.afterRender.call(this)), this.state = state, this._skipRender && this._skipRender++;
|
|
18844
18847
|
}
|
|
18845
18848
|
combineLayersToWindow() {
|
|
18846
18849
|
if ("harmony" === this.global.env) {
|
|
@@ -18946,7 +18949,7 @@ class Stage extends Group {
|
|
|
18946
18949
|
layer.release();
|
|
18947
18950
|
}), this.interactiveLayer && (this.interactiveLayer.forEachChildren(item => {
|
|
18948
18951
|
item.setStage && item.setStage(null, null), this.interactiveLayer.removeChild(item);
|
|
18949
|
-
}), this.interactiveLayer.release()), this.window.release(), this.ticker.remTimeline(this.timeline), this.renderService.renderTreeRoots = [];
|
|
18952
|
+
}), this.interactiveLayer.release()), this.window.release(), this.ticker.remTimeline(this.timeline), this.ticker.removeListener("afterTick", this.afterTickCb), this.renderService.renderTreeRoots = [];
|
|
18950
18953
|
}
|
|
18951
18954
|
setStage(stage) {}
|
|
18952
18955
|
dirty(b, matrix) {
|
|
@@ -19024,8 +19027,6 @@ function createStage(params) {
|
|
|
19024
19027
|
return new Stage(params);
|
|
19025
19028
|
}
|
|
19026
19029
|
|
|
19027
|
-
const strCommandMap = ["arc", "arcTo", "bezierCurveTo", "closePath", "ellipse", "lineTo", "moveTo", "quadraticCurveTo", "rect"];
|
|
19028
|
-
|
|
19029
19030
|
var __decorate$1d = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
19030
19031
|
var d,
|
|
19031
19032
|
c = arguments.length,
|
|
@@ -23646,11 +23647,9 @@ function jsx(type, config) {
|
|
|
23646
23647
|
name: name,
|
|
23647
23648
|
id: id,
|
|
23648
23649
|
attribute: attribute,
|
|
23649
|
-
stateProxy: stateProxy
|
|
23650
|
-
animation: animation,
|
|
23651
|
-
timeline: timeline
|
|
23650
|
+
stateProxy: stateProxy
|
|
23652
23651
|
} = _a,
|
|
23653
|
-
props = __rest(_a, ["key", "name", "id", "attribute", "stateProxy"
|
|
23652
|
+
props = __rest(_a, ["key", "name", "id", "attribute", "stateProxy"]);
|
|
23654
23653
|
let c = type;
|
|
23655
23654
|
isString$1(type) && (c = graphicCreator[type]);
|
|
23656
23655
|
const childrenList = [];
|
|
@@ -23659,13 +23658,7 @@ function jsx(type, config) {
|
|
|
23659
23658
|
}
|
|
23660
23659
|
children.length && flatten(1 === children.length ? children[0] : children, childrenList);
|
|
23661
23660
|
const g = "Group" === c.name ? new c(attribute) : c(config);
|
|
23662
|
-
|
|
23663
|
-
const animate = g.animate();
|
|
23664
|
-
timeline && animate.setTimeline(timeline), animation.forEach(item => {
|
|
23665
|
-
animate[item[0]](...item.slice(1));
|
|
23666
|
-
});
|
|
23667
|
-
}
|
|
23668
|
-
return g;
|
|
23661
|
+
return parseToGraphic$1(g, childrenList, props), stateProxy && (g.stateProxy = stateProxy), g;
|
|
23669
23662
|
}
|
|
23670
23663
|
function parseToGraphic$1(g, childrenList, props) {
|
|
23671
23664
|
let out,
|
|
@@ -23933,7 +23926,7 @@ class Gesture extends EventEmitter {
|
|
|
23933
23926
|
startTime: startTime,
|
|
23934
23927
|
startPoints: startPoints
|
|
23935
23928
|
} = this;
|
|
23936
|
-
if (eventType) return eventType;
|
|
23929
|
+
if ("press" === eventType) return eventType;
|
|
23937
23930
|
let type;
|
|
23938
23931
|
return type = clock.now() - startTime > this.config.press.time && calcDistance(startPoints[0], point) < this.config.press.threshold ? "press" : "pan", this.eventType = type, type;
|
|
23939
23932
|
}
|
|
@@ -24465,9 +24458,10 @@ let BrowserContext2d = class {
|
|
|
24465
24458
|
lineJoin = defaultParams.lineJoin,
|
|
24466
24459
|
lineDash = defaultParams.lineDash,
|
|
24467
24460
|
lineCap = defaultParams.lineCap,
|
|
24468
|
-
miterLimit = defaultParams.miterLimit
|
|
24461
|
+
miterLimit = defaultParams.miterLimit,
|
|
24462
|
+
keepStrokeScale = defaultParams.keepStrokeScale
|
|
24469
24463
|
} = attribute;
|
|
24470
|
-
_context.lineWidth = getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
24464
|
+
_context.lineWidth = keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
24471
24465
|
}
|
|
24472
24466
|
}
|
|
24473
24467
|
setTextStyleWithoutAlignBaseline(params, defaultParams, z) {
|
|
@@ -25367,8 +25361,9 @@ class PickerBase {
|
|
|
25367
25361
|
return this.canvasRenderer.drawShape(graphic, pickContext, x, y, {}, null, (context, arcAttribute, themeAttribute) => !!picked || (picked = context.isPointInPath(point.x, point.y), picked), (context, arcAttribute, themeAttribute) => {
|
|
25368
25362
|
if (picked) return !0;
|
|
25369
25363
|
const lineWidth = arcAttribute.lineWidth || themeAttribute.lineWidth,
|
|
25370
|
-
pickStrokeBuffer = arcAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer
|
|
25371
|
-
|
|
25364
|
+
pickStrokeBuffer = arcAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
|
|
25365
|
+
keepStrokeScale = arcAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
|
|
25366
|
+
return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(point.x, point.y), picked;
|
|
25372
25367
|
}), pickContext.highPerformanceRestore(), picked;
|
|
25373
25368
|
}
|
|
25374
25369
|
}
|
|
@@ -25641,8 +25636,9 @@ class RectPickerBase {
|
|
|
25641
25636
|
if (!onlyTranslate || rect.shadowRoot || isNumber$1(cornerRadius, !0) && 0 !== cornerRadius || isArray$1(cornerRadius) && cornerRadius.some(num => 0 !== num)) picked = !1, this.canvasRenderer.drawShape(rect, pickContext, x, y, {}, null, (context, rectAttribute, themeAttribute) => !!picked || (picked = context.isPointInPath(point.x, point.y), picked), (context, rectAttribute, themeAttribute) => {
|
|
25642
25637
|
if (picked) return !0;
|
|
25643
25638
|
const lineWidth = rectAttribute.lineWidth || themeAttribute.lineWidth,
|
|
25644
|
-
pickStrokeBuffer = rectAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer
|
|
25645
|
-
|
|
25639
|
+
pickStrokeBuffer = rectAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
|
|
25640
|
+
keepStrokeScale = rectAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
|
|
25641
|
+
return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(point.x, point.y), picked;
|
|
25646
25642
|
});else {
|
|
25647
25643
|
const {
|
|
25648
25644
|
fill = rectAttribute.fill,
|
|
@@ -25956,9 +25952,10 @@ let LynxContext2d = class extends BrowserContext2d {
|
|
|
25956
25952
|
lineJoin = defaultParams.lineJoin,
|
|
25957
25953
|
lineDash = defaultParams.lineDash,
|
|
25958
25954
|
lineCap = defaultParams.lineCap,
|
|
25959
|
-
miterLimit = defaultParams.miterLimit
|
|
25955
|
+
miterLimit = defaultParams.miterLimit,
|
|
25956
|
+
keepStrokeScale = defaultParams.keepStrokeScale
|
|
25960
25957
|
} = attribute;
|
|
25961
|
-
_context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, _context.lineWidth = getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
25958
|
+
_context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, _context.lineWidth = keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
25962
25959
|
}
|
|
25963
25960
|
}
|
|
25964
25961
|
measureText(text) {
|
|
@@ -26586,9 +26583,10 @@ let TaroContext2d = class extends BrowserContext2d {
|
|
|
26586
26583
|
lineJoin = defaultParams.lineJoin,
|
|
26587
26584
|
lineDash = defaultParams.lineDash,
|
|
26588
26585
|
lineCap = defaultParams.lineCap,
|
|
26589
|
-
miterLimit = defaultParams.miterLimit
|
|
26586
|
+
miterLimit = defaultParams.miterLimit,
|
|
26587
|
+
keepStrokeScale = defaultParams.keepStrokeScale
|
|
26590
26588
|
} = attribute;
|
|
26591
|
-
_context.setGlobalAlpha(strokeOpacity * opacity), _context.setLineWidth(getScaledStroke(this, lineWidth, this.dpr)), _context.setStrokeStyle(createColor(this, stroke, params, offsetX, offsetY)), _context.setLineJoin(lineJoin), lineDash && _context.setLineDash(lineDash), _context.setLineCap(lineCap), _context.setMiterLimit(miterLimit);
|
|
26589
|
+
_context.setGlobalAlpha(strokeOpacity * opacity), _context.setLineWidth(keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr)), _context.setStrokeStyle(createColor(this, stroke, params, offsetX, offsetY)), _context.setLineJoin(lineJoin), lineDash && _context.setLineDash(lineDash), _context.setLineCap(lineCap), _context.setMiterLimit(miterLimit);
|
|
26592
26590
|
}
|
|
26593
26591
|
}
|
|
26594
26592
|
setTextStyleWithoutAlignBaseline(params, defaultParams) {
|
|
@@ -27628,9 +27626,10 @@ let HarmonyContext2d = class extends BrowserContext2d {
|
|
|
27628
27626
|
lineJoin = defaultParams.lineJoin,
|
|
27629
27627
|
lineDash = defaultParams.lineDash,
|
|
27630
27628
|
lineCap = defaultParams.lineCap,
|
|
27631
|
-
miterLimit = defaultParams.miterLimit
|
|
27629
|
+
miterLimit = defaultParams.miterLimit,
|
|
27630
|
+
keepStrokeScale = defaultParams.keepStrokeScale
|
|
27632
27631
|
} = attribute;
|
|
27633
|
-
_context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, _context.lineWidth = getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
27632
|
+
_context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, _context.lineWidth = keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
27634
27633
|
}
|
|
27635
27634
|
}
|
|
27636
27635
|
measureText(text) {
|
|
@@ -28037,8 +28036,9 @@ class BaseLinePicker extends BaseRender {
|
|
|
28037
28036
|
return this.canvasRenderer.drawShape(graphic, pickContext, x, y, {}, null, context => !!picked || (picked = context.isPointInPath(pickPoint.x, pickPoint.y), picked), (context, lineAttribute, themeAttribute) => {
|
|
28038
28037
|
if (picked) return !0;
|
|
28039
28038
|
const lineWidth = lineAttribute.lineWidth || themeAttribute.lineWidth,
|
|
28040
|
-
pickStrokeBuffer = lineAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer
|
|
28041
|
-
|
|
28039
|
+
pickStrokeBuffer = lineAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
|
|
28040
|
+
keepStrokeScale = lineAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
|
|
28041
|
+
return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(pickPoint.x, pickPoint.y), picked;
|
|
28042
28042
|
}), this.canvasRenderer.z = 0, pickContext.modelMatrix !== lastModelMatrix && mat4Allocate.free(pickContext.modelMatrix), pickContext.modelMatrix = lastModelMatrix, pickContext.highPerformanceRestore(), picked;
|
|
28043
28043
|
}
|
|
28044
28044
|
}
|
|
@@ -28173,8 +28173,9 @@ let DefaultCanvasSymbolPicker = class extends Base3dPicker {
|
|
|
28173
28173
|
return this.canvasRenderer.drawShape(symbol, pickContext, x, y, {}, null, (context, symbolAttribute, themeAttribute) => !!picked || (picked = context.isPointInPath(pickPoint.x, pickPoint.y), picked), (context, symbolAttribute, themeAttribute) => {
|
|
28174
28174
|
if (picked) return !0;
|
|
28175
28175
|
const lineWidth = symbolAttribute.lineWidth || themeAttribute.lineWidth,
|
|
28176
|
-
pickStrokeBuffer = symbolAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer
|
|
28177
|
-
|
|
28176
|
+
pickStrokeBuffer = symbolAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
|
|
28177
|
+
keepStrokeScale = symbolAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
|
|
28178
|
+
return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(pickPoint.x, pickPoint.y), picked;
|
|
28178
28179
|
}), this.canvasRenderer.z = 0, pickContext.modelMatrix !== lastModelMatrix && mat4Allocate.free(pickContext.modelMatrix), pickContext.modelMatrix = lastModelMatrix, pickContext.highPerformanceRestore(), picked;
|
|
28179
28180
|
}
|
|
28180
28181
|
};
|
|
@@ -28611,7 +28612,7 @@ const registerWrapText = _registerWrapText;
|
|
|
28611
28612
|
|
|
28612
28613
|
const roughModule = _roughModule;
|
|
28613
28614
|
|
|
28614
|
-
const version = "0.21.0-alpha.
|
|
28615
|
+
const version = "0.21.0-alpha.6";
|
|
28615
28616
|
preLoadAllModule();
|
|
28616
28617
|
if (isBrowserEnv()) {
|
|
28617
28618
|
loadBrowserEnv(container);
|
|
@@ -28644,4 +28645,4 @@ registerReactAttributePlugin();
|
|
|
28644
28645
|
registerDirectionalLight();
|
|
28645
28646
|
registerOrthoCamera();
|
|
28646
28647
|
|
|
28647
|
-
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, BrowserEnvContribution, CIRCLE_NUMBER_TYPE, Canvas3DDrawItemInterceptor, Canvas3DPickItemInterceptor, CanvasArc3dPicker, CanvasArcPicker, CanvasAreaPicker, CanvasCirclePicker, CanvasFactory, CanvasGlyphPicker, CanvasGroupPicker, CanvasImagePicker, CanvasLinePicker, CanvasPathPicker, CanvasPickerContribution, CanvasPolygonPicker, CanvasPyramid3dPicker, CanvasRect3dPicker, CanvasRectPicker, CanvasRichTextPicker, CanvasSymbolPicker, CanvasTextLayout, CanvasTextPicker, 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, DragNDrop, DrawContribution, DrawItemInterceptor, DynamicLayerHandlerContribution, Edge, EmptyContext2d, EnvContribution, EventManager, EventSystem, EventTarget, FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND, Factory, FadeInPlus, FederatedEvent, FederatedMouseEvent, FederatedPointerEvent, FederatedWheelEvent, FlexLayoutPlugin, Fragment, GLYPH_NUMBER_TYPE, GRAPHIC_UPDATE_TAG_KEY, GROUP_NUMBER_TYPE, Generator, Gesture, 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, MathArcPicker, MathAreaPicker, MathCirclePicker, MathGlyphPicker, MathImagePicker, MathLinePicker, MathPathPicker, MathPickerContribution, MathPolygonPicker, MathRectPicker, MathSymbolPicker, MathTextPicker, 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, REACT_TO_CANOPUS_EVENTS, REACT_TO_CANOPUS_EVENTS_LIST, 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, VArc, VArc3d, VArea, VCircle, VGlobal, VGlyph, VGroup, VImage, VLine, VPath, VPolygon, VPyramid3d, VRect, VRect3d, VRichText, VSymbol, VText, VWindow, ViewTransform3dPlugin, VirtualLayerHandlerContribution, WILDCARD, WindowHandlerContribution, WrapText, XMLParser, _interpolateColor, _registerArc, addArcToBezierPath$1 as addArcToBezierPath, addAttributeToPrototype, alignBezierCurves, alignSubpath, application, applyTransformOnBezierCurves, arc3dCanvasPickModule, arc3dModule, arcCanvasPickModule, arcMathPickModule, arcModule, areaCanvasPickModule, areaMathPickModule, areaModule, bezier, bezierCurversToPath, binarySplitPolygon, bindContributionProvider, bindContributionProviderNoSingletonScope, boundStroke, browserEnvModule, builtInSymbolStrMap, builtinSymbols, builtinSymbolsMap, calcLineCache, calculateArcCornerRadius, calculateLineHeight, canvasAllocate, centroidOfSubpath, circleBounds, circleCanvasPickModule, circleMathPickModule, circleModule, clock, cloneGraphic, colorEqual, colorStringInterpolationToStr, container, cornerTangents, createArc, createArc3d, createArea, createCircle, createColor, createConicalGradient, createGlyph, createGroup, createImage, createImageElement$1 as createImageElement, createLine, createMat4, createPath, createPolygon, createPyramid3d, createRect, createRect3d, createRectPath, createRichText, createShadowRoot, createStage, createSymbol, createText, createWrapText, cubicCalc, cubicLength, cubicPointAt, cubicSubdivide, decodeReactDom, 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, feishuEnvModule, 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, glyphCanvasPickModule, glyphMathPickModule, glyphModule, graphicCreator, graphicService, graphicUtil, harmonyEnvModule, identityMat4, imageCanvasPickModule, imageMathPickModule, imageModule, incrementalAddTo, initAllEnv, initBrowserEnv, initFeishuEnv, initHarmonyEnv, initLynxEnv, initNodeEnv, initTTEnv, initTaroEnv, initWxEnv, inject, injectable, interpolateColor, interpolateGradientConicalColor, interpolateGradientLinearColor, interpolateGradientRadialColor, interpolatePureColorArray, intersect, isBrowserEnv, isNodeEnv, isSvg, isTransformKey, isXML, jsx, layerService, lineCanvasPickModule, lineMathPickModule, lineModule, loadAllEnv, loadAllModule, loadBrowserEnv, loadFeishuEnv, loadHarmonyEnv, loadLynxEnv, loadNodeEnv, loadTTEnv, loadTaroEnv, loadWxEnv, lookAt, lynxEnvModule, mat3Tomat4, mat4Allocate, matrixAllocate, morphPath, multiInject, multiToOneMorph, multiplyMat4Mat3, multiplyMat4Mat4, named, newThemeObj, nodeEnvModule, oneToMultiMorph, ortho, parsePadding, parseStroke, parseSvgPath, pathCanvasPickModule, pathMathPickModule, pathModule, pathToBezierCurves, point$3 as point, pointEqual, pointInterpolation, pointInterpolationHighPerformance, pointsEqual, pointsInterpolation, polygonCanvasPickModule, polygonMathPickModule, polygonModule, preLoadAllModule, pyramid3dCanvasPickModule, pyramid3dModule, rafBasedSto, rect3dCanvasPickModule, rect3dModule, rectCanvasPickModule, rectFillVisible, rectMathPickModule, rectModule, rectStrokeVisible, recursiveCallBinarySplit, registerArc, registerArc3d, registerArc3dGraphic, registerArcGraphic, registerArea, registerAreaGraphic, registerCircle, registerCircleGraphic, registerDirectionalLight, registerFlexLayoutPlugin, registerGlyph, registerGlyphGraphic, registerGroup, registerGroupGraphic, registerHtmlAttributePlugin, registerImage, registerImageGraphic, registerLine, registerLineGraphic, registerOrthoCamera, registerPath, registerPathGraphic, registerPolygon, registerPolygonGraphic, registerPyramid3d, registerPyramid3dGraphic, registerReactAttributePlugin, registerRect, registerRect3d, registerRect3dGraphic, registerRectGraphic, registerRichtext, registerRichtextGraphic, registerShadowRoot, registerShadowRootGraphic, registerSymbol, registerSymbolGraphic, registerText, registerTextGraphic, registerViewTransform3dPlugin, registerWrapText, registerWrapTextGraphic, renderCommandList, rewriteProto, richTextMathPickModule, richtextCanvasPickModule, richtextModule, rotateX, rotateY, rotateZ, roughModule, runFill, runStroke, scaleMat4, segments, shouldUseMat4, snapLength, splitArc, splitArea, splitCircle, splitGraphic, splitLine, splitPath, splitPolygon, splitRect, splitToGrids, strCommandMap, strokeVisible, symbolCanvasPickModule, symbolMathPickModule, symbolModule, taroEnvModule, textAttributesToStyle, textCanvasPickModule, textDrawOffsetX, textDrawOffsetY, textLayoutOffsetY, textMathPickModule, textModule, transformKeys, transformMat4, transformUtil, translate, ttEnvModule, version, verticalLayout, vglobal, waitForAllSubLayers, wrapCanvas, wrapContext, wxEnvModule, xul };
|
|
28648
|
+
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, BrowserEnvContribution, CIRCLE_NUMBER_TYPE, Canvas3DDrawItemInterceptor, Canvas3DPickItemInterceptor, CanvasArc3dPicker, CanvasArcPicker, CanvasAreaPicker, CanvasCirclePicker, CanvasFactory, CanvasGlyphPicker, CanvasGroupPicker, CanvasImagePicker, CanvasLinePicker, CanvasPathPicker, CanvasPickerContribution, CanvasPolygonPicker, CanvasPyramid3dPicker, CanvasRect3dPicker, CanvasRectPicker, CanvasRichTextPicker, CanvasSymbolPicker, CanvasTextLayout, CanvasTextPicker, 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, DragNDrop, DrawContribution, DrawItemInterceptor, DynamicLayerHandlerContribution, Edge, EmptyContext2d, EnvContribution, EventManager, EventSystem, EventTarget, FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND, Factory, FadeInPlus, FederatedEvent, FederatedMouseEvent, FederatedPointerEvent, FederatedWheelEvent, FlexLayoutPlugin, Fragment, GLYPH_NUMBER_TYPE, GRAPHIC_UPDATE_TAG_KEY, GROUP_NUMBER_TYPE, Generator, Gesture, 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, MathArcPicker, MathAreaPicker, MathCirclePicker, MathGlyphPicker, MathImagePicker, MathLinePicker, MathPathPicker, MathPickerContribution, MathPolygonPicker, MathRectPicker, MathSymbolPicker, MathTextPicker, 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, REACT_TO_CANOPUS_EVENTS, REACT_TO_CANOPUS_EVENTS_LIST, 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, VArc, VArc3d, VArea, VCircle, VGlobal, VGlyph, VGroup, VImage, VLine, VPath, VPolygon, VPyramid3d, VRect, VRect3d, VRichText, VSymbol, VText, VWindow, ViewTransform3dPlugin, VirtualLayerHandlerContribution, WILDCARD, WindowHandlerContribution, WrapText, XMLParser, _interpolateColor, _registerArc, addArcToBezierPath$1 as addArcToBezierPath, addAttributeToPrototype, alignBezierCurves, alignSubpath, application, applyTransformOnBezierCurves, arc3dCanvasPickModule, arc3dModule, arcCanvasPickModule, arcMathPickModule, arcModule, areaCanvasPickModule, areaMathPickModule, areaModule, bezier, bezierCurversToPath, binarySplitPolygon, bindContributionProvider, bindContributionProviderNoSingletonScope, boundStroke, browserEnvModule, builtInSymbolStrMap, builtinSymbols, builtinSymbolsMap, calcLineCache, calculateArcCornerRadius, calculateLineHeight, canvasAllocate, centroidOfSubpath, circleBounds, circleCanvasPickModule, circleMathPickModule, circleModule, clock, cloneGraphic, colorEqual, colorStringInterpolationToStr, container, cornerTangents, createArc, createArc3d, createArea, createCircle, createColor, createConicalGradient, createGlyph, createGroup, createImage, createImageElement$1 as createImageElement, createLine, createMat4, createPath, createPolygon, createPyramid3d, createRect, createRect3d, createRectPath, createRichText, createShadowRoot, createStage, createSymbol, createText, createWrapText, cubicCalc, cubicLength, cubicPointAt, cubicSubdivide, decodeReactDom, 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, feishuEnvModule, 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, glyphCanvasPickModule, glyphMathPickModule, glyphModule, graphicCreator, graphicService, graphicUtil, harmonyEnvModule, identityMat4, imageCanvasPickModule, imageMathPickModule, imageModule, incrementalAddTo, initAllEnv, initBrowserEnv, initFeishuEnv, initHarmonyEnv, initLynxEnv, initNodeEnv, initTTEnv, initTaroEnv, initWxEnv, inject, injectable, interpolateColor, interpolateGradientConicalColor, interpolateGradientLinearColor, interpolateGradientRadialColor, interpolatePureColorArray, intersect, isBrowserEnv, isNodeEnv, isSvg, isTransformKey, isXML, jsx, layerService, lineCanvasPickModule, lineMathPickModule, lineModule, loadAllEnv, loadAllModule, loadBrowserEnv, loadFeishuEnv, loadHarmonyEnv, loadLynxEnv, loadNodeEnv, loadTTEnv, loadTaroEnv, loadWxEnv, lookAt, lynxEnvModule, mat3Tomat4, mat4Allocate, matrixAllocate, morphPath, multiInject, multiToOneMorph, multiplyMat4Mat3, multiplyMat4Mat4, named, newThemeObj, nodeEnvModule, oneToMultiMorph, ortho, parsePadding, parseStroke, parseSvgPath, pathCanvasPickModule, pathMathPickModule, pathModule, pathToBezierCurves, point$3 as point, pointEqual, pointInterpolation, pointInterpolationHighPerformance, pointsEqual, pointsInterpolation, polygonCanvasPickModule, polygonMathPickModule, polygonModule, preLoadAllModule, pyramid3dCanvasPickModule, pyramid3dModule, rafBasedSto, rect3dCanvasPickModule, rect3dModule, rectCanvasPickModule, rectFillVisible, rectMathPickModule, rectModule, rectStrokeVisible, recursiveCallBinarySplit, registerArc, registerArc3d, registerArc3dGraphic, registerArcGraphic, registerArea, registerAreaGraphic, registerCircle, registerCircleGraphic, registerDirectionalLight, registerFlexLayoutPlugin, registerGlyph, registerGlyphGraphic, registerGroup, registerGroupGraphic, registerHtmlAttributePlugin, registerImage, registerImageGraphic, registerLine, registerLineGraphic, registerOrthoCamera, registerPath, registerPathGraphic, registerPolygon, registerPolygonGraphic, registerPyramid3d, registerPyramid3dGraphic, registerReactAttributePlugin, registerRect, registerRect3d, registerRect3dGraphic, registerRectGraphic, registerRichtext, registerRichtextGraphic, registerShadowRoot, registerShadowRootGraphic, registerSymbol, registerSymbolGraphic, registerText, registerTextGraphic, registerViewTransform3dPlugin, registerWrapText, registerWrapTextGraphic, renderCommandList, rewriteProto, richTextMathPickModule, richtextCanvasPickModule, richtextModule, rotateX, rotateY, rotateZ, roughModule, runFill, runStroke, scaleMat4, segments, shouldUseMat4, snapLength, splitArc, splitArea, splitCircle, splitGraphic, splitLine, splitPath, splitPolygon, splitRect, splitToGrids, strCommandMap, strokeVisible, symbolCanvasPickModule, symbolMathPickModule, symbolModule, taroEnvModule, textAttributesToStyle, textCanvasPickModule, textDrawOffsetX, textDrawOffsetY, textLayoutOffsetY, textMathPickModule, textModule, transformKeys, transformMat4, transformUtil, translate, ttEnvModule, version, verticalLayout, vglobal, waitForAllSubLayers, wrapCanvas, wrapContext, wxEnvModule, xul };
|