@visactor/vrender 0.20.0-alpha.4 → 0.20.0
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 +10 -11
- package/cjs/index.js.map +1 -1
- package/dist/index.es.js +46 -237
- package/dist/index.js +46 -237
- 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 +5 -5
package/dist/index.js
CHANGED
|
@@ -35,40 +35,11 @@
|
|
|
35
35
|
var Reflect$1 = (function (Reflect) {
|
|
36
36
|
var target;
|
|
37
37
|
return function (exporter) {
|
|
38
|
-
const
|
|
39
|
-
supportsSymbol = "function" == typeof Symbol,
|
|
38
|
+
const supportsSymbol = "function" == typeof Symbol,
|
|
40
39
|
toPrimitiveSymbol = supportsSymbol && void 0 !== Symbol.toPrimitive ? Symbol.toPrimitive : "@@toPrimitive",
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
__proto__: []
|
|
45
|
-
} instanceof Array,
|
|
46
|
-
downLevel = !supportsCreate && !supportsProto,
|
|
47
|
-
HashMap = {
|
|
48
|
-
create: supportsCreate ? function () {
|
|
49
|
-
return MakeDictionary(Object.create(null));
|
|
50
|
-
} : supportsProto ? function () {
|
|
51
|
-
return MakeDictionary({
|
|
52
|
-
__proto__: null
|
|
53
|
-
});
|
|
54
|
-
} : function () {
|
|
55
|
-
return MakeDictionary({});
|
|
56
|
-
},
|
|
57
|
-
has: downLevel ? function (map, key) {
|
|
58
|
-
return hasOwn.call(map, key);
|
|
59
|
-
} : function (map, key) {
|
|
60
|
-
return key in map;
|
|
61
|
-
},
|
|
62
|
-
get: downLevel ? function (map, key) {
|
|
63
|
-
return hasOwn.call(map, key) ? map[key] : void 0;
|
|
64
|
-
} : function (map, key) {
|
|
65
|
-
return map[key];
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
functionPrototype = Object.getPrototypeOf(Function),
|
|
69
|
-
usePolyfill = "object" == typeof process && process.env && "true" === process.env.REFLECT_METADATA_USE_MAP_POLYFILL,
|
|
70
|
-
_Map = usePolyfill || "function" != typeof Map || "function" != typeof Map.prototype.entries ? CreateMapPolyfill() : Map,
|
|
71
|
-
Metadata = (usePolyfill || "function" != typeof Set || "function" != typeof Set.prototype.entries ? CreateSetPolyfill() : Set, new (usePolyfill || "function" != typeof WeakMap ? CreateWeakMapPolyfill() : WeakMap)());
|
|
40
|
+
functionPrototype = (Object.getPrototypeOf(Function)),
|
|
41
|
+
_Map = ("object" == typeof process && process.env && process.env.REFLECT_METADATA_USE_MAP_POLYFILL, Map),
|
|
42
|
+
Metadata = (new WeakMap());
|
|
72
43
|
function defineMetadata(metadataKey, metadataValue, target, propertyKey) {
|
|
73
44
|
if (!IsObject(target)) throw new TypeError();
|
|
74
45
|
return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);
|
|
@@ -225,183 +196,6 @@
|
|
|
225
196
|
const constructor = prototypeProto.constructor;
|
|
226
197
|
return "function" != typeof constructor || constructor === O ? proto : constructor;
|
|
227
198
|
}
|
|
228
|
-
function CreateMapPolyfill() {
|
|
229
|
-
const cacheSentinel = {},
|
|
230
|
-
arraySentinel = [],
|
|
231
|
-
MapIterator = function () {
|
|
232
|
-
function MapIterator(keys, values, selector) {
|
|
233
|
-
this._index = 0, this._keys = keys, this._values = values, this._selector = selector;
|
|
234
|
-
}
|
|
235
|
-
return MapIterator.prototype["@@iterator"] = function () {
|
|
236
|
-
return this;
|
|
237
|
-
}, MapIterator.prototype[iteratorSymbol] = function () {
|
|
238
|
-
return this;
|
|
239
|
-
}, MapIterator.prototype.next = function () {
|
|
240
|
-
const index = this._index;
|
|
241
|
-
if (index >= 0 && index < this._keys.length) {
|
|
242
|
-
const result = this._selector(this._keys[index], this._values[index]);
|
|
243
|
-
return index + 1 >= this._keys.length ? (this._index = -1, this._keys = arraySentinel, this._values = arraySentinel) : this._index++, {
|
|
244
|
-
value: result,
|
|
245
|
-
done: !1
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
return {
|
|
249
|
-
value: void 0,
|
|
250
|
-
done: !0
|
|
251
|
-
};
|
|
252
|
-
}, MapIterator.prototype.throw = function (error) {
|
|
253
|
-
throw this._index >= 0 && (this._index = -1, this._keys = arraySentinel, this._values = arraySentinel), error;
|
|
254
|
-
}, MapIterator.prototype.return = function (value) {
|
|
255
|
-
return this._index >= 0 && (this._index = -1, this._keys = arraySentinel, this._values = arraySentinel), {
|
|
256
|
-
value: value,
|
|
257
|
-
done: !0
|
|
258
|
-
};
|
|
259
|
-
}, MapIterator;
|
|
260
|
-
}();
|
|
261
|
-
return function () {
|
|
262
|
-
function Map() {
|
|
263
|
-
this._keys = [], this._values = [], this._cacheKey = cacheSentinel, this._cacheIndex = -2;
|
|
264
|
-
}
|
|
265
|
-
return Object.defineProperty(Map.prototype, "size", {
|
|
266
|
-
get: function () {
|
|
267
|
-
return this._keys.length;
|
|
268
|
-
},
|
|
269
|
-
enumerable: !0,
|
|
270
|
-
configurable: !0
|
|
271
|
-
}), Map.prototype.has = function (key) {
|
|
272
|
-
return this._find(key, !1) >= 0;
|
|
273
|
-
}, Map.prototype.get = function (key) {
|
|
274
|
-
const index = this._find(key, !1);
|
|
275
|
-
return index >= 0 ? this._values[index] : void 0;
|
|
276
|
-
}, Map.prototype.set = function (key, value) {
|
|
277
|
-
const index = this._find(key, !0);
|
|
278
|
-
return this._values[index] = value, this;
|
|
279
|
-
}, Map.prototype.delete = function (key) {
|
|
280
|
-
const index = this._find(key, !1);
|
|
281
|
-
if (index >= 0) {
|
|
282
|
-
const size = this._keys.length;
|
|
283
|
-
for (let i = index + 1; i < size; i++) this._keys[i - 1] = this._keys[i], this._values[i - 1] = this._values[i];
|
|
284
|
-
return this._keys.length--, this._values.length--, key === this._cacheKey && (this._cacheKey = cacheSentinel, this._cacheIndex = -2), !0;
|
|
285
|
-
}
|
|
286
|
-
return !1;
|
|
287
|
-
}, Map.prototype.clear = function () {
|
|
288
|
-
this._keys.length = 0, this._values.length = 0, this._cacheKey = cacheSentinel, this._cacheIndex = -2;
|
|
289
|
-
}, Map.prototype.keys = function () {
|
|
290
|
-
return new MapIterator(this._keys, this._values, getKey);
|
|
291
|
-
}, Map.prototype.values = function () {
|
|
292
|
-
return new MapIterator(this._keys, this._values, getValue);
|
|
293
|
-
}, Map.prototype.entries = function () {
|
|
294
|
-
return new MapIterator(this._keys, this._values, getEntry);
|
|
295
|
-
}, Map.prototype["@@iterator"] = function () {
|
|
296
|
-
return this.entries();
|
|
297
|
-
}, Map.prototype[iteratorSymbol] = function () {
|
|
298
|
-
return this.entries();
|
|
299
|
-
}, Map.prototype._find = function (key, insert) {
|
|
300
|
-
return this._cacheKey !== key && (this._cacheIndex = this._keys.indexOf(this._cacheKey = key)), this._cacheIndex < 0 && insert && (this._cacheIndex = this._keys.length, this._keys.push(key), this._values.push(void 0)), this._cacheIndex;
|
|
301
|
-
}, Map;
|
|
302
|
-
}();
|
|
303
|
-
function getKey(key, _) {
|
|
304
|
-
return key;
|
|
305
|
-
}
|
|
306
|
-
function getValue(_, value) {
|
|
307
|
-
return value;
|
|
308
|
-
}
|
|
309
|
-
function getEntry(key, value) {
|
|
310
|
-
return [key, value];
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
function CreateSetPolyfill() {
|
|
314
|
-
return function () {
|
|
315
|
-
function Set() {
|
|
316
|
-
this._map = new _Map();
|
|
317
|
-
}
|
|
318
|
-
return Object.defineProperty(Set.prototype, "size", {
|
|
319
|
-
get: function () {
|
|
320
|
-
return this._map.size;
|
|
321
|
-
},
|
|
322
|
-
enumerable: !0,
|
|
323
|
-
configurable: !0
|
|
324
|
-
}), Set.prototype.has = function (value) {
|
|
325
|
-
return this._map.has(value);
|
|
326
|
-
}, Set.prototype.add = function (value) {
|
|
327
|
-
return this._map.set(value, value), this;
|
|
328
|
-
}, Set.prototype.delete = function (value) {
|
|
329
|
-
return this._map.delete(value);
|
|
330
|
-
}, Set.prototype.clear = function () {
|
|
331
|
-
this._map.clear();
|
|
332
|
-
}, Set.prototype.keys = function () {
|
|
333
|
-
return this._map.keys();
|
|
334
|
-
}, Set.prototype.values = function () {
|
|
335
|
-
return this._map.values();
|
|
336
|
-
}, Set.prototype.entries = function () {
|
|
337
|
-
return this._map.entries();
|
|
338
|
-
}, Set.prototype["@@iterator"] = function () {
|
|
339
|
-
return this.keys();
|
|
340
|
-
}, Set.prototype[iteratorSymbol] = function () {
|
|
341
|
-
return this.keys();
|
|
342
|
-
}, Set;
|
|
343
|
-
}();
|
|
344
|
-
}
|
|
345
|
-
function CreateWeakMapPolyfill() {
|
|
346
|
-
const UUID_SIZE = 16,
|
|
347
|
-
keys = HashMap.create(),
|
|
348
|
-
rootKey = CreateUniqueKey();
|
|
349
|
-
return function () {
|
|
350
|
-
function WeakMap() {
|
|
351
|
-
this._key = CreateUniqueKey();
|
|
352
|
-
}
|
|
353
|
-
return WeakMap.prototype.has = function (target) {
|
|
354
|
-
const table = GetOrCreateWeakMapTable(target, !1);
|
|
355
|
-
return void 0 !== table && HashMap.has(table, this._key);
|
|
356
|
-
}, WeakMap.prototype.get = function (target) {
|
|
357
|
-
const table = GetOrCreateWeakMapTable(target, !1);
|
|
358
|
-
return void 0 !== table ? HashMap.get(table, this._key) : void 0;
|
|
359
|
-
}, WeakMap.prototype.set = function (target, value) {
|
|
360
|
-
return GetOrCreateWeakMapTable(target, !0)[this._key] = value, this;
|
|
361
|
-
}, WeakMap.prototype.delete = function (target) {
|
|
362
|
-
const table = GetOrCreateWeakMapTable(target, !1);
|
|
363
|
-
return void 0 !== table && delete table[this._key];
|
|
364
|
-
}, WeakMap.prototype.clear = function () {
|
|
365
|
-
this._key = CreateUniqueKey();
|
|
366
|
-
}, WeakMap;
|
|
367
|
-
}();
|
|
368
|
-
function CreateUniqueKey() {
|
|
369
|
-
let key;
|
|
370
|
-
do {
|
|
371
|
-
key = "@@WeakMap@@" + CreateUUID();
|
|
372
|
-
} while (HashMap.has(keys, key));
|
|
373
|
-
return keys[key] = !0, key;
|
|
374
|
-
}
|
|
375
|
-
function GetOrCreateWeakMapTable(target, create) {
|
|
376
|
-
if (!hasOwn.call(target, rootKey)) {
|
|
377
|
-
if (!create) return;
|
|
378
|
-
Object.defineProperty(target, rootKey, {
|
|
379
|
-
value: HashMap.create()
|
|
380
|
-
});
|
|
381
|
-
}
|
|
382
|
-
return target[rootKey];
|
|
383
|
-
}
|
|
384
|
-
function FillRandomBytes(buffer, size) {
|
|
385
|
-
for (let i = 0; i < size; ++i) buffer[i] = 255 * Math.random() | 0;
|
|
386
|
-
return buffer;
|
|
387
|
-
}
|
|
388
|
-
function GenRandomBytes(size) {
|
|
389
|
-
return "function" == typeof Uint8Array ? "undefined" != typeof crypto ? crypto.getRandomValues(new Uint8Array(size)) : FillRandomBytes(new Uint8Array(size), size) : FillRandomBytes(new Array(size), size);
|
|
390
|
-
}
|
|
391
|
-
function CreateUUID() {
|
|
392
|
-
const data = GenRandomBytes(UUID_SIZE);
|
|
393
|
-
data[6] = 79 & data[6] | 64, data[8] = 191 & data[8] | 128;
|
|
394
|
-
let result = "";
|
|
395
|
-
for (let offset = 0; offset < UUID_SIZE; ++offset) {
|
|
396
|
-
const byte = data[offset];
|
|
397
|
-
4 !== offset && 6 !== offset && 8 !== offset || (result += "-"), byte < 16 && (result += "0"), result += byte.toString(16).toLowerCase();
|
|
398
|
-
}
|
|
399
|
-
return result;
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
function MakeDictionary(obj) {
|
|
403
|
-
return obj.__ = void 0, delete obj.__, obj;
|
|
404
|
-
}
|
|
405
199
|
exporter("defineMetadata", defineMetadata), exporter("hasMetadata", hasMetadata), exporter("hasOwnMetadata", hasOwnMetadata), exporter("getMetadata", getMetadata);
|
|
406
200
|
}((target = Reflect, function (key, value) {
|
|
407
201
|
"function" != typeof target[key] && Object.defineProperty(target, key, {
|
|
@@ -12189,7 +11983,7 @@
|
|
|
12189
11983
|
const defaultGroupBackgroundRenderContribution = new DefaultGroupBackgroundRenderContribution();
|
|
12190
11984
|
|
|
12191
11985
|
const halfPi = pi / 2;
|
|
12192
|
-
function createRectPath(path, x, y, width, height, rectCornerRadius) {
|
|
11986
|
+
function createRectPath(path, x, y, width, height, rectCornerRadius, edgeCb) {
|
|
12193
11987
|
let cornerRadius;
|
|
12194
11988
|
if (width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber$1(rectCornerRadius, !0)) cornerRadius = [rectCornerRadius = abs(rectCornerRadius), rectCornerRadius, rectCornerRadius, rectCornerRadius];else if (Array.isArray(rectCornerRadius)) {
|
|
12195
11989
|
const cornerRadiusArr = rectCornerRadius;
|
|
@@ -12221,27 +12015,28 @@
|
|
|
12221
12015
|
rightBottomPoint2 = [rightBottom[0], rightBottom[1] - _cornerRadius[2]],
|
|
12222
12016
|
leftBottomPoint1 = [leftBottom[0] + _cornerRadius[3], leftBottom[1]],
|
|
12223
12017
|
leftBottomPoint2 = [leftBottom[0], leftBottom[1] - _cornerRadius[3]];
|
|
12224
|
-
if (path.moveTo(leftTopPoint1[0], leftTopPoint1[1]), path.lineTo(rightTopPoint1[0], rightTopPoint1[1]), !arrayEqual(rightTopPoint1, rightTopPoint2)) {
|
|
12018
|
+
if (path.moveTo(leftTopPoint1[0], leftTopPoint1[1]), edgeCb && edgeCb[0] ? edgeCb[0](leftTopPoint1[0], leftTopPoint1[1], rightTopPoint1[0], rightTopPoint1[1]) : path.lineTo(rightTopPoint1[0], rightTopPoint1[1]), !arrayEqual(rightTopPoint1, rightTopPoint2)) {
|
|
12019
|
+
edgeCb && edgeCb[0] && path.moveTo(rightTopPoint1[0], rightTopPoint1[1]);
|
|
12225
12020
|
const centerX = rightTopPoint1[0],
|
|
12226
12021
|
centerY = rightTopPoint1[1] + _cornerRadius[1];
|
|
12227
12022
|
path.arc(centerX, centerY, _cornerRadius[1], -halfPi, 0, !1);
|
|
12228
12023
|
}
|
|
12229
|
-
if (path.lineTo(rightBottomPoint2[0], rightBottomPoint2[1]), !arrayEqual(rightBottomPoint1, rightBottomPoint2)) {
|
|
12024
|
+
if (edgeCb && edgeCb[1] ? edgeCb[1](rightTopPoint2[0], rightTopPoint2[1], rightBottomPoint2[0], rightBottomPoint2[1]) : path.lineTo(rightBottomPoint2[0], rightBottomPoint2[1]), !arrayEqual(rightBottomPoint1, rightBottomPoint2)) {
|
|
12230
12025
|
const centerX = rightBottomPoint2[0] - _cornerRadius[2],
|
|
12231
12026
|
centerY = rightBottomPoint2[1];
|
|
12232
|
-
path.arc(centerX, centerY, _cornerRadius[2], 0, halfPi, !1);
|
|
12027
|
+
edgeCb && edgeCb[1] && path.moveTo(rightBottomPoint2[0], rightBottomPoint2[1]), path.arc(centerX, centerY, _cornerRadius[2], 0, halfPi, !1);
|
|
12233
12028
|
}
|
|
12234
|
-
if (path.lineTo(leftBottomPoint1[0], leftBottomPoint1[1]), !arrayEqual(leftBottomPoint1, leftBottomPoint2)) {
|
|
12029
|
+
if (edgeCb && edgeCb[2] ? edgeCb[2](rightBottomPoint1[0], rightBottomPoint1[1], leftBottomPoint1[0], leftBottomPoint1[1]) : path.lineTo(leftBottomPoint1[0], leftBottomPoint1[1]), !arrayEqual(leftBottomPoint1, leftBottomPoint2)) {
|
|
12235
12030
|
const centerX = leftBottomPoint1[0],
|
|
12236
12031
|
centerY = leftBottomPoint1[1] - _cornerRadius[3];
|
|
12237
|
-
path.arc(centerX, centerY, _cornerRadius[3], halfPi, pi, !1);
|
|
12032
|
+
edgeCb && edgeCb[2] && path.moveTo(leftBottomPoint1[0], leftBottomPoint1[1]), path.arc(centerX, centerY, _cornerRadius[3], halfPi, pi, !1);
|
|
12238
12033
|
}
|
|
12239
|
-
if (path.lineTo(leftTopPoint2[0], leftTopPoint2[1]), !arrayEqual(leftTopPoint1, leftTopPoint2)) {
|
|
12034
|
+
if (edgeCb && edgeCb[3] ? edgeCb[3](leftBottomPoint2[0], leftBottomPoint2[1], leftTopPoint2[0], leftTopPoint2[1]) : path.lineTo(leftTopPoint2[0], leftTopPoint2[1]), !arrayEqual(leftTopPoint1, leftTopPoint2)) {
|
|
12240
12035
|
const centerX = leftTopPoint1[0],
|
|
12241
12036
|
centerY = leftTopPoint1[1] + _cornerRadius[0];
|
|
12242
|
-
path.arc(centerX, centerY, _cornerRadius[0], pi, pi + halfPi, !1);
|
|
12037
|
+
edgeCb && edgeCb[3] && path.moveTo(leftTopPoint2[0], leftTopPoint2[1]), path.arc(centerX, centerY, _cornerRadius[0], pi, pi + halfPi, !1);
|
|
12243
12038
|
}
|
|
12244
|
-
return path.closePath(), path;
|
|
12039
|
+
return !edgeCb && path.closePath(), path;
|
|
12245
12040
|
}
|
|
12246
12041
|
|
|
12247
12042
|
var __decorate$1z = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
@@ -12318,14 +12113,24 @@
|
|
|
12318
12113
|
y1: y1,
|
|
12319
12114
|
x: originX = groupAttribute.x,
|
|
12320
12115
|
y: originY = groupAttribute.y,
|
|
12321
|
-
stroke = groupAttribute.stroke
|
|
12116
|
+
stroke = groupAttribute.stroke,
|
|
12117
|
+
cornerRadius = groupAttribute.cornerRadius
|
|
12322
12118
|
} = rect.attribute;
|
|
12323
12119
|
let {
|
|
12324
12120
|
width: width,
|
|
12325
12121
|
height: height
|
|
12326
12122
|
} = rect.attribute;
|
|
12327
12123
|
if (width = (null != width ? width : x1 - originX) || 0, height = (null != height ? height : y1 - originY) || 0, Array.isArray(stroke) && stroke.some(s => !1 === s)) {
|
|
12328
|
-
if (context.setStrokeStyle(rect, rect.attribute, x, y, groupAttribute),
|
|
12124
|
+
if (context.setStrokeStyle(rect, rect.attribute, x, y, groupAttribute), !(0 === cornerRadius || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num))) {
|
|
12125
|
+
let lastStroke,
|
|
12126
|
+
lastStrokeI = 0;
|
|
12127
|
+
return createRectPath(context, x, y, width, height, cornerRadius, new Array(4).fill(0).map((_, i) => (x1, y1, x2, y2) => {
|
|
12128
|
+
stroke[i] && (lastStrokeI === i - 1 && stroke[i] === lastStroke || (context.setStrokeStyle(rect, Object.assign(Object.assign({}, rect.attribute), {
|
|
12129
|
+
stroke: stroke[i]
|
|
12130
|
+
}), x, y, groupAttribute), context.beginPath(), context.moveTo(x1, y1), lastStroke = stroke[i]), lastStrokeI = i, context.lineTo(x2, y2), context.stroke(), 3 === i && context.beginPath());
|
|
12131
|
+
})), void context.stroke();
|
|
12132
|
+
}
|
|
12133
|
+
if (context.beginPath(), context.moveTo(x, y), stroke[0] ? context.lineTo(x + width, y) : context.moveTo(x + width, y), stroke[1] ? context.lineTo(x + width, y + height) : context.moveTo(x + width, y + height), stroke[2] ? context.lineTo(x, y + height) : context.moveTo(x, y + height), stroke[3]) {
|
|
12329
12134
|
const adjustY = stroke[0] ? y - context.lineWidth / 2 : y;
|
|
12330
12135
|
context.lineTo(x, adjustY);
|
|
12331
12136
|
} else context.moveTo(x, y);
|
|
@@ -13169,9 +12974,9 @@
|
|
|
13169
12974
|
data = this.valid(area, areaAttribute, fillCb, strokeCb);
|
|
13170
12975
|
if (!data) return;
|
|
13171
12976
|
const {
|
|
13172
|
-
doFill: doFill
|
|
13173
|
-
doStroke: doStroke
|
|
12977
|
+
doFill: doFill
|
|
13174
12978
|
} = data,
|
|
12979
|
+
doStroke = data.doStroke && data.sVisible,
|
|
13175
12980
|
{
|
|
13176
12981
|
clipRange = areaAttribute.clipRange,
|
|
13177
12982
|
closePath: closePath,
|
|
@@ -13989,7 +13794,9 @@
|
|
|
13989
13794
|
clip: clip,
|
|
13990
13795
|
baseOpacity = 1
|
|
13991
13796
|
} = group.attribute;
|
|
13992
|
-
clip ? context.save() : context.highPerformanceSave()
|
|
13797
|
+
clip ? context.save() : context.highPerformanceSave();
|
|
13798
|
+
const baseGlobalAlpha = context.baseGlobalAlpha;
|
|
13799
|
+
context.baseGlobalAlpha *= baseOpacity;
|
|
13993
13800
|
const groupAttribute = getTheme(group, null == params ? void 0 : params.theme).group,
|
|
13994
13801
|
lastModelMatrix = context.modelMatrix;
|
|
13995
13802
|
if (context.camera) {
|
|
@@ -14003,7 +13810,7 @@
|
|
|
14003
13810
|
scrollY = groupAttribute.scrollY
|
|
14004
13811
|
} = group.attribute;
|
|
14005
13812
|
let p;
|
|
14006
|
-
(scrollX || scrollY) && context.translate(scrollX, scrollY), params && params.drawingCb && (p = params.drawingCb()), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, context.baseGlobalAlpha
|
|
13813
|
+
(scrollX || scrollY) && context.translate(scrollX, scrollY), params && params.drawingCb && (p = params.drawingCb()), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, context.baseGlobalAlpha = baseGlobalAlpha, p && p.then ? p.then(() => {
|
|
14007
13814
|
clip ? context.restore() : context.highPerformanceRestore();
|
|
14008
13815
|
}) : clip ? context.restore() : context.highPerformanceRestore();
|
|
14009
13816
|
}
|
|
@@ -14182,7 +13989,7 @@
|
|
|
14182
13989
|
const m = graphic.globalTransMatrix.getInverse();
|
|
14183
13990
|
drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m), drawContribution.backupDirtyBounds.copy(drawContribution.dirtyBounds);
|
|
14184
13991
|
}
|
|
14185
|
-
return drawContribution.renderGroup(graphic.shadowRoot, drawContext,
|
|
13992
|
+
return drawContribution.renderGroup(graphic.shadowRoot, drawContext, matrixAllocate.allocate(1, 0, 0, 1, 0, 0)), context.highPerformanceRestore(), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds && (drawContribution.dirtyBounds.copy(tempDirtyBounds), drawContribution.backupDirtyBounds.copy(tempBackupDirtyBounds)), !0;
|
|
14186
13993
|
}
|
|
14187
13994
|
}
|
|
14188
13995
|
class DebugDrawItemInterceptorContribution {
|
|
@@ -16550,20 +16357,21 @@
|
|
|
16550
16357
|
this.frame.lines.push(line), this.frame.actualHeight += line.height, this.y += line.height, this.lineBuffer.length = 0, this.lineWidth = this.maxAscent = this.maxDescent = this.maxAscentForBlank = this.maxDescentForBlank = 0;
|
|
16551
16358
|
}
|
|
16552
16359
|
deal(paragraph) {
|
|
16553
|
-
|
|
16360
|
+
let singleLine = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
16361
|
+
paragraph instanceof RichTextIcon ? "horizontal" === this.direction && 0 === this.width || "vertical" === this.direction && 0 === this.height || this.lineWidth + paragraph[this.directionKey.width] <= this[this.directionKey.width] ? this.store(paragraph) : 0 === this.lineBuffer.length ? (this.store(paragraph), this.send()) : (this.send(), this.deal(paragraph)) : "number" != typeof this.width || this.width < 0 || (paragraph.newLine && this.send(), 0 !== paragraph.text.length && ("horizontal" === this.direction && 0 === this.width || "vertical" === this.direction && 0 === this.height || this.lineWidth + paragraph[this.directionKey.width] <= this[this.directionKey.width] ? this.store(paragraph) : this.lineWidth === this[this.directionKey.width] ? (this.send(), this.deal(paragraph)) : this.cut(paragraph, singleLine)));
|
|
16554
16362
|
}
|
|
16555
|
-
cut(paragraph) {
|
|
16363
|
+
cut(paragraph, singleLine) {
|
|
16556
16364
|
const availableWidth = this[this.directionKey.width] - this.lineWidth || 0,
|
|
16557
16365
|
guessIndex = Math.ceil(availableWidth / paragraph[this.directionKey.width] * paragraph.length) || 0,
|
|
16558
16366
|
index = getStrByWithCanvas(paragraph.text, availableWidth, paragraph.character, guessIndex, "break-word" === this.frame.wordBreak);
|
|
16559
16367
|
if (0 !== index) {
|
|
16560
16368
|
const [p1, p2] = seperateParagraph(paragraph, index);
|
|
16561
|
-
this.store(p1), this.deal(p2);
|
|
16369
|
+
this.store(p1), singleLine ? this.send() : this.deal(p2);
|
|
16562
16370
|
} else 0 !== this.lineBuffer.length && (this.send(), this.deal(paragraph));
|
|
16563
16371
|
}
|
|
16564
16372
|
}
|
|
16565
16373
|
|
|
16566
|
-
const RICHTEXT_UPDATE_TAG_KEY = ["width", "height", "ellipsis", "wordBreak", "verticalDirection", "maxHeight", "maxWidth", "textAlign", "textBaseline", "textConfig", "layoutDirection", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
16374
|
+
const RICHTEXT_UPDATE_TAG_KEY = ["width", "height", "ellipsis", "wordBreak", "verticalDirection", "maxHeight", "maxWidth", "textAlign", "textBaseline", "textConfig", "layoutDirection", "fill", "stroke", "fontSize", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
16567
16375
|
class RichText extends Graphic {
|
|
16568
16376
|
constructor(params) {
|
|
16569
16377
|
super(params), this.type = "richtext", this._currentHoverIcon = null, this.numberType = RICHTEXT_NUMBER_TYPE;
|
|
@@ -16765,7 +16573,7 @@
|
|
|
16765
16573
|
skip = !1;
|
|
16766
16574
|
for (let i = 0; i < paragraphs.length; i++) {
|
|
16767
16575
|
const p = paragraphs[i];
|
|
16768
|
-
skip ? (p.overflow = !0, p.left = 1 / 0, p.top = 1 / 0, !p.newLine && frame.lines[frame.lines.length - 1].paragraphs.push(p)) : wrapper.deal(p), frame.lines.length !== lineCount && (lineCount = frame.lines.length, wrapper.lineBuffer.length = 0, p.overflow = !0, p.left = 1e3, p.top = 1e3, frame.lines[frame.lines.length - 1].paragraphs.push(p), skip = !0), p.newLine && (skip = !1, wrapper.lineWidth = 0);
|
|
16576
|
+
skip ? (p.overflow = !0, p.left = 1 / 0, p.top = 1 / 0, !p.newLine && frame.lines[frame.lines.length - 1].paragraphs.push(p)) : wrapper.deal(p, !0), frame.lines.length !== lineCount && (lineCount = frame.lines.length, wrapper.lineBuffer.length = 0, p.overflow = !0, p.left = 1e3, p.top = 1e3, frame.lines[frame.lines.length - 1].paragraphs.push(p), skip = !0), p.newLine && (skip = !1, wrapper.lineWidth = 0), wrapper.send();
|
|
16769
16577
|
}
|
|
16770
16578
|
} else for (let i = 0; i < paragraphs.length; i++) wrapper.deal(paragraphs[i]);
|
|
16771
16579
|
wrapper.send();
|
|
@@ -16806,10 +16614,11 @@
|
|
|
16806
16614
|
let pickIcon;
|
|
16807
16615
|
return frameCache.icons.forEach(icon => {
|
|
16808
16616
|
var _a, _b;
|
|
16809
|
-
icon.AABBBounds.
|
|
16617
|
+
const bounds = icon.AABBBounds.clone();
|
|
16618
|
+
bounds.translate(icon._marginArray[3], icon._marginArray[0]), bounds.containsPoint({
|
|
16810
16619
|
x: point.x - x,
|
|
16811
16620
|
y: point.y - y
|
|
16812
|
-
}) && (pickIcon = icon, pickIcon.globalX = (null !== (_a = pickIcon.attribute.x) && void 0 !== _a ? _a : 0) + x, pickIcon.globalY = (null !== (_b = pickIcon.attribute.y) && void 0 !== _b ? _b : 0) + y);
|
|
16621
|
+
}) && (pickIcon = icon, pickIcon.globalX = (null !== (_a = pickIcon.attribute.x) && void 0 !== _a ? _a : 0) + x + icon._marginArray[3], pickIcon.globalY = (null !== (_b = pickIcon.attribute.y) && void 0 !== _b ? _b : 0) + y + icon._marginArray[0]);
|
|
16813
16622
|
}), pickIcon;
|
|
16814
16623
|
}
|
|
16815
16624
|
getNoWorkAnimateAttr() {
|
|
@@ -24254,7 +24063,7 @@
|
|
|
24254
24063
|
opacity = defaultParams.opacity,
|
|
24255
24064
|
fill = defaultParams.fill
|
|
24256
24065
|
} = attribute;
|
|
24257
|
-
fillOpacity > 1e-12 && opacity > 1e-12
|
|
24066
|
+
_context.globalAlpha = fillOpacity * opacity * this.baseGlobalAlpha, fillOpacity > 1e-12 && opacity > 1e-12 && (_context.fillStyle = createColor(this, fill, params, offsetX, offsetY));
|
|
24258
24067
|
}
|
|
24259
24068
|
setShadowBlendStyle(params, attribute, defaultParams) {
|
|
24260
24069
|
if (Array.isArray(defaultParams)) {
|
|
@@ -24297,7 +24106,7 @@
|
|
|
24297
24106
|
strokeOpacity = defaultParams.strokeOpacity,
|
|
24298
24107
|
opacity = defaultParams.opacity
|
|
24299
24108
|
} = attribute;
|
|
24300
|
-
if (strokeOpacity > 1e-12 && opacity > 1e-12) {
|
|
24109
|
+
if (_context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, strokeOpacity > 1e-12 && opacity > 1e-12) {
|
|
24301
24110
|
const {
|
|
24302
24111
|
lineWidth = defaultParams.lineWidth,
|
|
24303
24112
|
stroke = defaultParams.stroke,
|
|
@@ -24306,7 +24115,7 @@
|
|
|
24306
24115
|
lineCap = defaultParams.lineCap,
|
|
24307
24116
|
miterLimit = defaultParams.miterLimit
|
|
24308
24117
|
} = attribute;
|
|
24309
|
-
_context.
|
|
24118
|
+
_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;
|
|
24310
24119
|
}
|
|
24311
24120
|
}
|
|
24312
24121
|
setTextStyleWithoutAlignBaseline(params, defaultParams, z) {
|
|
@@ -28450,7 +28259,7 @@
|
|
|
28450
28259
|
|
|
28451
28260
|
const roughModule = _roughModule;
|
|
28452
28261
|
|
|
28453
|
-
const version = "0.20.0
|
|
28262
|
+
const version = "0.20.0";
|
|
28454
28263
|
preLoadAllModule();
|
|
28455
28264
|
if (isBrowserEnv()) {
|
|
28456
28265
|
loadBrowserEnv(container);
|