@antv/g 5.5.0 → 5.5.1
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/dist/css/StyleValueRegistry.d.ts +1 -0
- package/dist/css/StyleValueRegistry.d.ts.map +1 -1
- package/dist/css/cssom/CSSNumericValue.d.ts +1 -1
- package/dist/css/cssom/CSSStyleValue.d.ts +2 -2
- package/dist/css/cssom/CSSStyleValue.d.ts.map +1 -1
- package/dist/css/layout/LayoutObject.d.ts +2 -2
- package/dist/css/layout/LayoutObject.d.ts.map +1 -1
- package/dist/css/parser/dimension.d.ts +1 -0
- package/dist/css/parser/dimension.d.ts.map +1 -1
- package/dist/css/properties/CSSPropertyClipPath.d.ts +1 -0
- package/dist/css/properties/CSSPropertyClipPath.d.ts.map +1 -1
- package/dist/css/properties/CSSPropertyLengthOrPercentage.d.ts.map +1 -1
- package/dist/css/properties/CSSPropertyNumber.d.ts +8 -0
- package/dist/css/properties/CSSPropertyNumber.d.ts.map +1 -0
- package/dist/css/properties/index.d.ts +1 -0
- package/dist/css/properties/index.d.ts.map +1 -1
- package/dist/display-objects/DisplayObject.d.ts +1 -0
- package/dist/display-objects/DisplayObject.d.ts.map +1 -1
- package/dist/display-objects/Line.d.ts.map +1 -1
- package/dist/display-objects/Path.d.ts +1 -1
- package/dist/display-objects/Path.d.ts.map +1 -1
- package/dist/display-objects/Polyline.d.ts.map +1 -1
- package/dist/global-module.d.ts.map +1 -1
- package/dist/index.esm.js +185 -96
- package/dist/index.js +184 -96
- package/dist/index.umd.js +184 -96
- package/dist/index.umd.min.js +2 -2
- package/dist/plugins/DirtyCheckPlugin.d.ts +0 -1
- package/dist/plugins/DirtyCheckPlugin.d.ts.map +1 -1
- package/dist/plugins/PrepareRendererPlugin.d.ts +1 -0
- package/dist/plugins/PrepareRendererPlugin.d.ts.map +1 -1
- package/dist/services/RenderingService.d.ts +9 -1
- package/dist/services/RenderingService.d.ts.map +1 -1
- package/dist/services/SceneGraphService.d.ts +6 -1
- package/dist/services/SceneGraphService.d.ts.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/index.umd.js
CHANGED
|
@@ -12215,8 +12215,8 @@
|
|
|
12215
12215
|
return exports.UnitType.kPixels;
|
|
12216
12216
|
|
|
12217
12217
|
case exports.UnitCategory.kUPercent:
|
|
12218
|
-
return exports.UnitType.
|
|
12219
|
-
// Cannot convert between numbers and percent.
|
|
12218
|
+
return exports.UnitType.kPercentage;
|
|
12219
|
+
// return UnitType.kUnknown; // Cannot convert between numbers and percent.
|
|
12220
12220
|
|
|
12221
12221
|
case exports.UnitCategory.kUTime:
|
|
12222
12222
|
return exports.UnitType.kSeconds;
|
|
@@ -15437,6 +15437,10 @@
|
|
|
15437
15437
|
*/
|
|
15438
15438
|
|
|
15439
15439
|
function parseLengthOrPercentage(css) {
|
|
15440
|
+
if (isNumber(css)) {
|
|
15441
|
+
return new CSSUnitValue(css, 'px');
|
|
15442
|
+
}
|
|
15443
|
+
|
|
15440
15444
|
return parseDimension(new RegExp('px|%|em|rem', 'g'), css);
|
|
15441
15445
|
}
|
|
15442
15446
|
function parseAngle(css) {
|
|
@@ -15448,6 +15452,7 @@
|
|
|
15448
15452
|
* @example
|
|
15449
15453
|
* 10px + 20px = 30px
|
|
15450
15454
|
* 10deg + 10rad
|
|
15455
|
+
* 10% + 20% = 30%
|
|
15451
15456
|
*/
|
|
15452
15457
|
|
|
15453
15458
|
function mergeDimensions(left, right, target, nonNegative, index) {
|
|
@@ -15457,23 +15462,29 @@
|
|
|
15457
15462
|
|
|
15458
15463
|
var unit = '';
|
|
15459
15464
|
var leftValue = left.value || 0;
|
|
15460
|
-
var rightValue = right.value || 0;
|
|
15461
|
-
|
|
15462
|
-
|
|
15463
|
-
|
|
15464
|
-
|
|
15465
|
-
if (
|
|
15466
|
-
leftValue =
|
|
15467
|
-
rightValue =
|
|
15468
|
-
unit =
|
|
15469
|
-
}
|
|
15470
|
-
|
|
15465
|
+
var rightValue = right.value || 0;
|
|
15466
|
+
var canonicalUnit = CSSUnitValue.toCanonicalUnit(left.unit);
|
|
15467
|
+
var leftCanonicalUnitValue = left.convertTo(canonicalUnit);
|
|
15468
|
+
var rightCanonicalUnitValue = right.convertTo(canonicalUnit);
|
|
15469
|
+
|
|
15470
|
+
if (leftCanonicalUnitValue && rightCanonicalUnitValue) {
|
|
15471
|
+
leftValue = leftCanonicalUnitValue.value;
|
|
15472
|
+
rightValue = rightCanonicalUnitValue.value;
|
|
15473
|
+
unit = CSSUnitValue.unitTypeToString(left.unit);
|
|
15474
|
+
} else {
|
|
15475
|
+
// format '%' to 'px'
|
|
15476
|
+
if (CSSUnitValue.isLength(left.unit) || CSSUnitValue.isLength(right.unit)) {
|
|
15477
|
+
leftValue = convertPercentUnit(left, index, target);
|
|
15478
|
+
rightValue = convertPercentUnit(right, index, target);
|
|
15479
|
+
unit = 'px';
|
|
15480
|
+
}
|
|
15481
|
+
} // // format 'rad' 'turn' to 'deg'
|
|
15482
|
+
// if (CSSUnitValue.isAngle(left.unit) || CSSUnitValue.isAngle(right.unit)) {
|
|
15483
|
+
// leftValue = convertAngleUnit(left);
|
|
15484
|
+
// rightValue = convertAngleUnit(right);
|
|
15485
|
+
// unit = 'deg';
|
|
15486
|
+
// }
|
|
15471
15487
|
|
|
15472
|
-
if (CSSUnitValue.isAngle(left.unit) || CSSUnitValue.isAngle(right.unit)) {
|
|
15473
|
-
leftValue = convertAngleUnit(left);
|
|
15474
|
-
rightValue = convertAngleUnit(right);
|
|
15475
|
-
unit = 'deg';
|
|
15476
|
-
}
|
|
15477
15488
|
|
|
15478
15489
|
return [leftValue, rightValue, function (value) {
|
|
15479
15490
|
if (nonNegative) {
|
|
@@ -21219,6 +21230,7 @@
|
|
|
21219
21230
|
_this.styleValueRegistry = GlobalContainer$1.get(StyleValueRegistry);
|
|
21220
21231
|
_this.isCustomElement = false;
|
|
21221
21232
|
_this.activeAnimations = [];
|
|
21233
|
+
_this.mutationEvent = new MutationEvent(exports.ElementEvent.ATTR_MODIFIED, _assertThisInitialized(_this), null, null, null, MutationEvent.MODIFICATION, null, null);
|
|
21222
21234
|
_this.config = config; // compatible with G 3.0
|
|
21223
21235
|
|
|
21224
21236
|
_this.config.interactive = (_this$config$capture = _this.config.capture) !== null && _this$config$capture !== void 0 ? _this$config$capture : _this.config.interactive; // init scene graph node
|
|
@@ -21365,7 +21377,8 @@
|
|
|
21365
21377
|
|
|
21366
21378
|
if (this.parsedStyle.clipPathTargets && this.parsedStyle.clipPathTargets.length) {
|
|
21367
21379
|
this.parsedStyle.clipPathTargets.forEach(function (target) {
|
|
21368
|
-
dirtifyToRoot(target);
|
|
21380
|
+
_this2.sceneGraphService.dirtifyToRoot(target);
|
|
21381
|
+
|
|
21369
21382
|
target.dispatchEvent(new MutationEvent(exports.ElementEvent.ATTR_MODIFIED, target, _this2, _this2, 'clipPath', MutationEvent.MODIFICATION, _this2, _this2));
|
|
21370
21383
|
|
|
21371
21384
|
if (target.isCustomElement && target.isConnected) {
|
|
@@ -21377,8 +21390,15 @@
|
|
|
21377
21390
|
} // redraw at next frame
|
|
21378
21391
|
|
|
21379
21392
|
|
|
21380
|
-
renderable.dirty = true;
|
|
21381
|
-
this.
|
|
21393
|
+
renderable.dirty = true; // trigger later
|
|
21394
|
+
// this.sceneGraphService.pendingEvents.push([ElementEvent.ATTR_MODIFIED, { affectChildren }]);
|
|
21395
|
+
|
|
21396
|
+
this.mutationEvent.prevValue = oldValue;
|
|
21397
|
+
this.mutationEvent.newValue = value;
|
|
21398
|
+
this.mutationEvent.attrName = name;
|
|
21399
|
+
this.mutationEvent.prevParsedValue = oldParsedValue;
|
|
21400
|
+
this.mutationEvent.newParsedValue = this.parsedStyle[name];
|
|
21401
|
+
this.dispatchEvent(this.mutationEvent);
|
|
21382
21402
|
|
|
21383
21403
|
if (this.isCustomElement && this.isConnected) {
|
|
21384
21404
|
if (this.attributeChangedCallback) {
|
|
@@ -22218,9 +22238,17 @@
|
|
|
22218
22238
|
x1 = _this$parsedStyle.x1,
|
|
22219
22239
|
y1 = _this$parsedStyle.y1,
|
|
22220
22240
|
x2 = _this$parsedStyle.x2,
|
|
22221
|
-
y2 = _this$parsedStyle.y2
|
|
22222
|
-
|
|
22223
|
-
|
|
22241
|
+
y2 = _this$parsedStyle.y2,
|
|
22242
|
+
defX = _this$parsedStyle.defX,
|
|
22243
|
+
defY = _this$parsedStyle.defY;
|
|
22244
|
+
|
|
22245
|
+
var _LineUtil$pointAt = line.pointAt(x1.value, y1.value, x2.value, y2.value, ratio),
|
|
22246
|
+
x = _LineUtil$pointAt.x,
|
|
22247
|
+
y = _LineUtil$pointAt.y;
|
|
22248
|
+
|
|
22249
|
+
var transformed = transformMat4(create$2(), fromValues$1(x - defX, y - defY, 0), this.getLocalTransform()); // apply local transformation
|
|
22250
|
+
|
|
22251
|
+
return new Point(transformed[0], transformed[1]);
|
|
22224
22252
|
};
|
|
22225
22253
|
|
|
22226
22254
|
_proto.getTotalLength = function getTotalLength() {
|
|
@@ -22265,7 +22293,10 @@
|
|
|
22265
22293
|
;
|
|
22266
22294
|
|
|
22267
22295
|
_proto.getPoint = function getPoint(ratio) {
|
|
22268
|
-
var _this$parsedStyle
|
|
22296
|
+
var _this$parsedStyle = this.parsedStyle,
|
|
22297
|
+
defX = _this$parsedStyle.defX,
|
|
22298
|
+
defY = _this$parsedStyle.defY,
|
|
22299
|
+
_this$parsedStyle$pat = _this$parsedStyle.path,
|
|
22269
22300
|
totalLength = _this$parsedStyle$pat.totalLength,
|
|
22270
22301
|
absolutePath = _this$parsedStyle$pat.absolutePath;
|
|
22271
22302
|
|
|
@@ -22273,7 +22304,9 @@
|
|
|
22273
22304
|
x = _getPointAtLength.x,
|
|
22274
22305
|
y = _getPointAtLength.y;
|
|
22275
22306
|
|
|
22276
|
-
|
|
22307
|
+
var transformed = transformMat4(create$2(), fromValues$1(x - defX, y - defY, 0), this.getLocalTransform()); // apply local transformation
|
|
22308
|
+
|
|
22309
|
+
return new Point(transformed[0], transformed[1]);
|
|
22277
22310
|
}
|
|
22278
22311
|
/**
|
|
22279
22312
|
* Get start tangent vector
|
|
@@ -22378,7 +22411,10 @@
|
|
|
22378
22411
|
};
|
|
22379
22412
|
|
|
22380
22413
|
_proto.getPoint = function getPoint(ratio) {
|
|
22381
|
-
var _this$parsedStyle
|
|
22414
|
+
var _this$parsedStyle = this.parsedStyle,
|
|
22415
|
+
defX = _this$parsedStyle.defX,
|
|
22416
|
+
defY = _this$parsedStyle.defY,
|
|
22417
|
+
_this$parsedStyle$poi = _this$parsedStyle.points,
|
|
22382
22418
|
points = _this$parsedStyle$poi.points,
|
|
22383
22419
|
segments = _this$parsedStyle$poi.segments;
|
|
22384
22420
|
var subt = 0;
|
|
@@ -22394,7 +22430,9 @@
|
|
|
22394
22430
|
x = _LineUtil$pointAt.x,
|
|
22395
22431
|
y = _LineUtil$pointAt.y;
|
|
22396
22432
|
|
|
22397
|
-
|
|
22433
|
+
var transformed = transformMat4(create$2(), fromValues$1(x - defX, y - defY, 0), this.getLocalTransform()); // apply local transformation
|
|
22434
|
+
|
|
22435
|
+
return new Point(transformed[0], transformed[1]);
|
|
22398
22436
|
};
|
|
22399
22437
|
|
|
22400
22438
|
_proto.getStartTangent = function getStartTangent() {
|
|
@@ -24194,29 +24232,6 @@
|
|
|
24194
24232
|
|
|
24195
24233
|
return zIndex1 - zIndex2;
|
|
24196
24234
|
}
|
|
24197
|
-
function dirtifyToRoot(element, affectChildren) {
|
|
24198
|
-
if (affectChildren === void 0) {
|
|
24199
|
-
affectChildren = false;
|
|
24200
|
-
}
|
|
24201
|
-
|
|
24202
|
-
var p = element;
|
|
24203
|
-
|
|
24204
|
-
while (p) {
|
|
24205
|
-
var renderable = p.renderable;
|
|
24206
|
-
|
|
24207
|
-
if (renderable) {
|
|
24208
|
-
renderable.renderBoundsDirty = true;
|
|
24209
|
-
renderable.boundsDirty = true;
|
|
24210
|
-
renderable.dirty = true;
|
|
24211
|
-
}
|
|
24212
|
-
|
|
24213
|
-
p = p.parentNode;
|
|
24214
|
-
}
|
|
24215
|
-
|
|
24216
|
-
element.dispatchEvent(new CustomEvent(exports.ElementEvent.BOUNDS_CHANGED, {
|
|
24217
|
-
affectChildren: affectChildren
|
|
24218
|
-
}));
|
|
24219
|
-
}
|
|
24220
24235
|
var SceneGraphService = exports.Syringe.defineToken('SceneGraphService');
|
|
24221
24236
|
/**
|
|
24222
24237
|
* update transform in scene graph
|
|
@@ -24229,6 +24244,8 @@
|
|
|
24229
24244
|
var _this = this;
|
|
24230
24245
|
|
|
24231
24246
|
this.sceneGraphSelectorFactory = void 0;
|
|
24247
|
+
this.pendingEvents = [];
|
|
24248
|
+
this.boundsChangedEvent = new CustomEvent(exports.ElementEvent.BOUNDS_CHANGED);
|
|
24232
24249
|
|
|
24233
24250
|
this.rotate = function () {
|
|
24234
24251
|
var parentInvertRotation = create$4();
|
|
@@ -24662,7 +24679,60 @@
|
|
|
24662
24679
|
}
|
|
24663
24680
|
|
|
24664
24681
|
this.dirtifyWorldInternal(element, transform);
|
|
24665
|
-
dirtifyToRoot(element, true);
|
|
24682
|
+
this.dirtifyToRoot(element, true);
|
|
24683
|
+
};
|
|
24684
|
+
|
|
24685
|
+
_proto.triggerPendingEvents = function triggerPendingEvents() {
|
|
24686
|
+
var _this2 = this;
|
|
24687
|
+
|
|
24688
|
+
var set = new Set();
|
|
24689
|
+
|
|
24690
|
+
var trigger = function trigger(element, detail) {
|
|
24691
|
+
if (!set.has(element.entity)) {
|
|
24692
|
+
_this2.boundsChangedEvent.detail = detail;
|
|
24693
|
+
element.dispatchEvent(_this2.boundsChangedEvent);
|
|
24694
|
+
set.add(element.entity);
|
|
24695
|
+
}
|
|
24696
|
+
};
|
|
24697
|
+
|
|
24698
|
+
this.pendingEvents.forEach(function (_ref) {
|
|
24699
|
+
var element = _ref[0],
|
|
24700
|
+
detail = _ref[1];
|
|
24701
|
+
|
|
24702
|
+
if (detail.affectChildren) {
|
|
24703
|
+
element.forEach(function (e) {
|
|
24704
|
+
trigger(e, detail);
|
|
24705
|
+
});
|
|
24706
|
+
} else {
|
|
24707
|
+
trigger(element, detail);
|
|
24708
|
+
}
|
|
24709
|
+
});
|
|
24710
|
+
this.pendingEvents = [];
|
|
24711
|
+
};
|
|
24712
|
+
|
|
24713
|
+
_proto.dirtifyToRoot = function dirtifyToRoot(element, affectChildren) {
|
|
24714
|
+
if (affectChildren === void 0) {
|
|
24715
|
+
affectChildren = false;
|
|
24716
|
+
}
|
|
24717
|
+
|
|
24718
|
+
var p = element;
|
|
24719
|
+
|
|
24720
|
+
while (p) {
|
|
24721
|
+
var renderable = p.renderable;
|
|
24722
|
+
|
|
24723
|
+
if (renderable) {
|
|
24724
|
+
renderable.renderBoundsDirty = true;
|
|
24725
|
+
renderable.boundsDirty = true;
|
|
24726
|
+
renderable.dirty = true;
|
|
24727
|
+
}
|
|
24728
|
+
|
|
24729
|
+
p = p.parentNode;
|
|
24730
|
+
} // reuse the same custom event
|
|
24731
|
+
|
|
24732
|
+
|
|
24733
|
+
this.pendingEvents.push([element, {
|
|
24734
|
+
affectChildren: affectChildren
|
|
24735
|
+
}]);
|
|
24666
24736
|
};
|
|
24667
24737
|
|
|
24668
24738
|
_proto.getPosition = function getPosition(element) {
|
|
@@ -24798,7 +24868,7 @@
|
|
|
24798
24868
|
;
|
|
24799
24869
|
|
|
24800
24870
|
_proto.getBounds = function getBounds(element, render) {
|
|
24801
|
-
var
|
|
24871
|
+
var _this3 = this;
|
|
24802
24872
|
|
|
24803
24873
|
if (render === void 0) {
|
|
24804
24874
|
render = false;
|
|
@@ -24819,7 +24889,7 @@
|
|
|
24819
24889
|
|
|
24820
24890
|
var children = element.childNodes;
|
|
24821
24891
|
children.forEach(function (child) {
|
|
24822
|
-
var childBounds =
|
|
24892
|
+
var childBounds = _this3.getBounds(child, render);
|
|
24823
24893
|
|
|
24824
24894
|
if (childBounds) {
|
|
24825
24895
|
if (!aabb) {
|
|
@@ -24831,7 +24901,7 @@
|
|
|
24831
24901
|
}
|
|
24832
24902
|
}); // account for clip path
|
|
24833
24903
|
|
|
24834
|
-
var clipPath = element.
|
|
24904
|
+
var clipPath = element.parsedStyle.clipPath;
|
|
24835
24905
|
|
|
24836
24906
|
if (clipPath) {
|
|
24837
24907
|
var clipPathBounds = this.getTransformedGeometryBounds(clipPath, true);
|
|
@@ -24922,7 +24992,7 @@
|
|
|
24922
24992
|
};
|
|
24923
24993
|
|
|
24924
24994
|
_proto.dirtifyWorldInternal = function dirtifyWorldInternal(element, transform) {
|
|
24925
|
-
var
|
|
24995
|
+
var _this4 = this;
|
|
24926
24996
|
|
|
24927
24997
|
if (!transform.dirtyFlag) {
|
|
24928
24998
|
transform.dirtyFlag = true;
|
|
@@ -24931,7 +25001,7 @@
|
|
|
24931
25001
|
var childTransform = child.transformable;
|
|
24932
25002
|
|
|
24933
25003
|
if (!childTransform.dirtyFlag) {
|
|
24934
|
-
|
|
25004
|
+
_this4.dirtifyWorldInternal(child, childTransform);
|
|
24935
25005
|
}
|
|
24936
25006
|
});
|
|
24937
25007
|
var renderable = element.renderable;
|
|
@@ -24941,8 +25011,6 @@
|
|
|
24941
25011
|
renderable.boundsDirty = true;
|
|
24942
25012
|
renderable.dirty = true;
|
|
24943
25013
|
}
|
|
24944
|
-
|
|
24945
|
-
element.dispatchEvent(new MutationEvent(exports.ElementEvent.ATTR_MODIFIED, element, null, null, 'modelMatrix', MutationEvent.MODIFICATION, null, null));
|
|
24946
25014
|
}
|
|
24947
25015
|
};
|
|
24948
25016
|
|
|
@@ -26180,6 +26248,7 @@
|
|
|
26180
26248
|
exports.RenderingService = /*#__PURE__*/function () {
|
|
26181
26249
|
function RenderingService() {
|
|
26182
26250
|
this.renderingPluginProvider = void 0;
|
|
26251
|
+
this.canvasConfig = void 0;
|
|
26183
26252
|
this.renderingContext = void 0;
|
|
26184
26253
|
this.sceneGraphService = void 0;
|
|
26185
26254
|
this.styleValueRegistry = void 0;
|
|
@@ -26293,6 +26362,21 @@
|
|
|
26293
26362
|
|
|
26294
26363
|
_proto.getStats = function getStats() {
|
|
26295
26364
|
return this.stats;
|
|
26365
|
+
}
|
|
26366
|
+
/**
|
|
26367
|
+
* Meet the following conditions:
|
|
26368
|
+
* * disable DirtyRectangleRendering
|
|
26369
|
+
* * camera changed
|
|
26370
|
+
*/
|
|
26371
|
+
;
|
|
26372
|
+
|
|
26373
|
+
_proto.disableDirtyRectangleRendering = function disableDirtyRectangleRendering() {
|
|
26374
|
+
var renderer = this.canvasConfig.renderer;
|
|
26375
|
+
|
|
26376
|
+
var _renderer$getConfig = renderer.getConfig(),
|
|
26377
|
+
enableDirtyRectangleRendering = _renderer$getConfig.enableDirtyRectangleRendering;
|
|
26378
|
+
|
|
26379
|
+
return !enableDirtyRectangleRendering || this.renderingContext.renderReasons.has(exports.RenderReason.CAMERA_CHANGED);
|
|
26296
26380
|
};
|
|
26297
26381
|
|
|
26298
26382
|
_proto.render = function render(canvasConfig) {
|
|
@@ -26302,6 +26386,7 @@
|
|
|
26302
26386
|
this.stats.rendered = 0;
|
|
26303
26387
|
this.zIndexCounter = 0;
|
|
26304
26388
|
this.sceneGraphService.syncHierarchy(this.renderingContext.root);
|
|
26389
|
+
this.sceneGraphService.triggerPendingEvents();
|
|
26305
26390
|
|
|
26306
26391
|
if (this.renderingContext.renderReasons.size && this.inited) {
|
|
26307
26392
|
this.renderDisplayObject(this.renderingContext.root, canvasConfig);
|
|
@@ -26389,6 +26474,8 @@
|
|
|
26389
26474
|
|
|
26390
26475
|
__decorate([contrib(RenderingPluginContribution), __metadata("design:type", Object)], exports.RenderingService.prototype, "renderingPluginProvider", void 0);
|
|
26391
26476
|
|
|
26477
|
+
__decorate([inject(CanvasConfig), __metadata("design:type", Object)], exports.RenderingService.prototype, "canvasConfig", void 0);
|
|
26478
|
+
|
|
26392
26479
|
__decorate([inject(RenderingContext), __metadata("design:type", Object)], exports.RenderingService.prototype, "renderingContext", void 0);
|
|
26393
26480
|
|
|
26394
26481
|
__decorate([inject(SceneGraphService), __metadata("design:type", Object)], exports.RenderingService.prototype, "sceneGraphService", void 0);
|
|
@@ -28382,7 +28469,9 @@
|
|
|
28382
28469
|
*/
|
|
28383
28470
|
|
|
28384
28471
|
exports.CSSPropertyClipPath = /*#__PURE__*/function () {
|
|
28385
|
-
function CSSPropertyClipPath() {
|
|
28472
|
+
function CSSPropertyClipPath() {
|
|
28473
|
+
this.sceneGraphService = void 0;
|
|
28474
|
+
}
|
|
28386
28475
|
|
|
28387
28476
|
var _proto = CSSPropertyClipPath.prototype;
|
|
28388
28477
|
|
|
@@ -28406,13 +28495,15 @@
|
|
|
28406
28495
|
newClipPath.parsedStyle.clipPathTargets.push(object);
|
|
28407
28496
|
}
|
|
28408
28497
|
|
|
28409
|
-
dirtifyToRoot(object);
|
|
28498
|
+
this.sceneGraphService.dirtifyToRoot(object);
|
|
28410
28499
|
return newClipPath;
|
|
28411
28500
|
};
|
|
28412
28501
|
|
|
28413
28502
|
return CSSPropertyClipPath;
|
|
28414
28503
|
}();
|
|
28415
28504
|
|
|
28505
|
+
__decorate([inject(SceneGraphService), __metadata("design:type", Object)], exports.CSSPropertyClipPath.prototype, "sceneGraphService", void 0);
|
|
28506
|
+
|
|
28416
28507
|
exports.CSSPropertyClipPath = __decorate([singleton({
|
|
28417
28508
|
token: {
|
|
28418
28509
|
token: CSSProperty,
|
|
@@ -28492,21 +28583,6 @@
|
|
|
28492
28583
|
_proto.calculator = function calculator(name, oldParsed, computed, object, registry) {
|
|
28493
28584
|
if (CSSUnitValue.isRelativeUnit(computed.unit)) {
|
|
28494
28585
|
if (computed.unit === exports.UnitType.kPercentage) {
|
|
28495
|
-
// try to resolve according to parent's geometry bounds
|
|
28496
|
-
// if (object.parentElement) {
|
|
28497
|
-
// // registry.registerParentGeometryBoundsChangedHandler(object, name);
|
|
28498
|
-
// return this.calculateUsedValueWithParentBounds(object, name);
|
|
28499
|
-
// } else {
|
|
28500
|
-
// registry.addUnresolveProperty(object, name);
|
|
28501
|
-
// // defer calculation after mounted
|
|
28502
|
-
// // object.addEventListener(
|
|
28503
|
-
// // ElementEvent.MOUNTED,
|
|
28504
|
-
// // () => {
|
|
28505
|
-
// // registry.registerParentGeometryBoundsChangedHandler(object, name);
|
|
28506
|
-
// // },
|
|
28507
|
-
// // { once: true },
|
|
28508
|
-
// // );
|
|
28509
|
-
// }
|
|
28510
28586
|
return new CSSUnitValue(0, 'px');
|
|
28511
28587
|
} else if (computed.unit === exports.UnitType.kEms) {
|
|
28512
28588
|
if (object.parentNode) {
|
|
@@ -28540,10 +28616,13 @@
|
|
|
28540
28616
|
}();
|
|
28541
28617
|
|
|
28542
28618
|
exports.CSSPropertyLengthOrPercentage = __decorate([singleton({
|
|
28543
|
-
token: {
|
|
28619
|
+
token: [{
|
|
28544
28620
|
token: CSSProperty,
|
|
28545
28621
|
named: exports.PropertySyntax.LENGTH_PERCENTAGE
|
|
28546
|
-
}
|
|
28622
|
+
}, {
|
|
28623
|
+
token: CSSProperty,
|
|
28624
|
+
named: exports.PropertySyntax.LENGTH
|
|
28625
|
+
}]
|
|
28547
28626
|
})], exports.CSSPropertyLengthOrPercentage);
|
|
28548
28627
|
|
|
28549
28628
|
/**
|
|
@@ -28712,6 +28791,18 @@
|
|
|
28712
28791
|
}
|
|
28713
28792
|
})], exports.CSSPropertyLocalPosition);
|
|
28714
28793
|
|
|
28794
|
+
exports.CSSPropertyNumber = function CSSPropertyNumber() {
|
|
28795
|
+
this.mixer = mergeNumbers;
|
|
28796
|
+
this.parser = parseNumber;
|
|
28797
|
+
};
|
|
28798
|
+
|
|
28799
|
+
exports.CSSPropertyNumber = __decorate([singleton({
|
|
28800
|
+
token: {
|
|
28801
|
+
token: CSSProperty,
|
|
28802
|
+
named: exports.PropertySyntax.NUMBER
|
|
28803
|
+
}
|
|
28804
|
+
})], exports.CSSPropertyNumber);
|
|
28805
|
+
|
|
28715
28806
|
exports.CSSPropertyOffsetDistance = /*#__PURE__*/function () {
|
|
28716
28807
|
function CSSPropertyOffsetDistance() {
|
|
28717
28808
|
this.parser = parseNumber;
|
|
@@ -29598,6 +29689,7 @@
|
|
|
29598
29689
|
this.cache = {};
|
|
29599
29690
|
this.unresolvedProperties = {};
|
|
29600
29691
|
this.propertySyntaxFactory = void 0;
|
|
29692
|
+
this.sceneGraphService = void 0;
|
|
29601
29693
|
this.cascadeProperties = {};
|
|
29602
29694
|
}
|
|
29603
29695
|
|
|
@@ -30043,9 +30135,8 @@
|
|
|
30043
30135
|
var usedOriginYValue = (flipX ? -1 : 1) * convertPercentUnit(transformOrigin[1], 1, object);
|
|
30044
30136
|
usedOriginXValue = usedOriginXValue - (flipY ? -1 : 1) * (anchor && anchor[0].value || 0) * geometry.contentBounds.halfExtents[0] * 2;
|
|
30045
30137
|
usedOriginYValue = usedOriginYValue - (flipX ? -1 : 1) * (anchor && anchor[1].value || 0) * geometry.contentBounds.halfExtents[1] * 2;
|
|
30046
|
-
object.setOrigin(usedOriginXValue, usedOriginYValue);
|
|
30047
|
-
|
|
30048
|
-
dirtifyToRoot(object);
|
|
30138
|
+
object.setOrigin(usedOriginXValue, usedOriginYValue);
|
|
30139
|
+
this.sceneGraphService.dirtifyToRoot(object);
|
|
30049
30140
|
}
|
|
30050
30141
|
};
|
|
30051
30142
|
|
|
@@ -30064,6 +30155,8 @@
|
|
|
30064
30155
|
|
|
30065
30156
|
__decorate([inject(CSSPropertySyntaxFactory), __metadata("design:type", Function)], exports.DefaultStyleValueRegistry.prototype, "propertySyntaxFactory", void 0);
|
|
30066
30157
|
|
|
30158
|
+
__decorate([inject(SceneGraphService), __metadata("design:type", Object)], exports.DefaultStyleValueRegistry.prototype, "sceneGraphService", void 0);
|
|
30159
|
+
|
|
30067
30160
|
__decorate([inversify.postConstruct(), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", void 0)], exports.DefaultStyleValueRegistry.prototype, "init", null);
|
|
30068
30161
|
|
|
30069
30162
|
exports.DefaultStyleValueRegistry = __decorate([singleton({
|
|
@@ -30113,6 +30206,7 @@
|
|
|
30113
30206
|
}
|
|
30114
30207
|
}); // bind CSS property handlers
|
|
30115
30208
|
|
|
30209
|
+
register(exports.CSSPropertyNumber);
|
|
30116
30210
|
register(exports.CSSPropertyAngle);
|
|
30117
30211
|
register(exports.CSSPropertyClipPath);
|
|
30118
30212
|
register(exports.CSSPropertyColor);
|
|
@@ -30378,22 +30472,15 @@
|
|
|
30378
30472
|
*/
|
|
30379
30473
|
|
|
30380
30474
|
var DirtyCheckPlugin = DirtyCheckPlugin_1 = (_class$2 = /*#__PURE__*/function () {
|
|
30381
|
-
function DirtyCheckPlugin() {
|
|
30382
|
-
this.renderingContext = void 0;
|
|
30383
|
-
}
|
|
30475
|
+
function DirtyCheckPlugin() {}
|
|
30384
30476
|
|
|
30385
30477
|
var _proto = DirtyCheckPlugin.prototype;
|
|
30386
30478
|
|
|
30387
30479
|
_proto.apply = function apply(renderingService) {
|
|
30388
|
-
var _this = this;
|
|
30389
|
-
|
|
30390
30480
|
renderingService.hooks.dirtycheck.tap(DirtyCheckPlugin_1.tag, function (object) {
|
|
30391
30481
|
if (object) {
|
|
30392
30482
|
var renderable = object.renderable;
|
|
30393
|
-
|
|
30394
|
-
var isCameraDirty = _this.renderingContext.renderReasons.has(exports.RenderReason.CAMERA_CHANGED);
|
|
30395
|
-
|
|
30396
|
-
var isDirty = renderable.dirty || isCameraDirty;
|
|
30483
|
+
var isDirty = renderable.dirty || renderingService.disableDirtyRectangleRendering();
|
|
30397
30484
|
|
|
30398
30485
|
if (isDirty) {
|
|
30399
30486
|
return object;
|
|
@@ -30408,9 +30495,6 @@
|
|
|
30408
30495
|
|
|
30409
30496
|
return DirtyCheckPlugin;
|
|
30410
30497
|
}(), _class$2.tag = 'DirtyCheck', _class$2);
|
|
30411
|
-
|
|
30412
|
-
__decorate([inject(RenderingContext), __metadata("design:type", Object)], DirtyCheckPlugin.prototype, "renderingContext", void 0);
|
|
30413
|
-
|
|
30414
30498
|
DirtyCheckPlugin = DirtyCheckPlugin_1 = __decorate([singleton({
|
|
30415
30499
|
contrib: RenderingPluginContribution
|
|
30416
30500
|
})], DirtyCheckPlugin);
|
|
@@ -30835,6 +30919,7 @@
|
|
|
30835
30919
|
function PrepareRendererPlugin() {
|
|
30836
30920
|
this.renderingContext = void 0;
|
|
30837
30921
|
this.styleValueRegistry = void 0;
|
|
30922
|
+
this.sceneGraphService = void 0;
|
|
30838
30923
|
this.rBush = void 0;
|
|
30839
30924
|
this.toSync = new Set();
|
|
30840
30925
|
}
|
|
@@ -30881,7 +30966,8 @@
|
|
|
30881
30966
|
|
|
30882
30967
|
_this2.styleValueRegistry.recalc(object);
|
|
30883
30968
|
|
|
30884
|
-
dirtifyToRoot(object);
|
|
30969
|
+
_this2.sceneGraphService.dirtifyToRoot(object);
|
|
30970
|
+
|
|
30885
30971
|
renderingService.dirtify();
|
|
30886
30972
|
};
|
|
30887
30973
|
|
|
@@ -30895,7 +30981,8 @@
|
|
|
30895
30981
|
_this2.toSync.delete(object);
|
|
30896
30982
|
}
|
|
30897
30983
|
|
|
30898
|
-
dirtifyToRoot(e.target);
|
|
30984
|
+
_this2.sceneGraphService.dirtifyToRoot(e.target);
|
|
30985
|
+
|
|
30899
30986
|
renderingService.dirtify();
|
|
30900
30987
|
};
|
|
30901
30988
|
|
|
@@ -30985,6 +31072,8 @@
|
|
|
30985
31072
|
|
|
30986
31073
|
__decorate([inject(StyleValueRegistry), __metadata("design:type", Object)], PrepareRendererPlugin.prototype, "styleValueRegistry", void 0);
|
|
30987
31074
|
|
|
31075
|
+
__decorate([inject(SceneGraphService), __metadata("design:type", Object)], PrepareRendererPlugin.prototype, "sceneGraphService", void 0);
|
|
31076
|
+
|
|
30988
31077
|
__decorate([inject(RBushRoot), __metadata("design:type", RBush)], PrepareRendererPlugin.prototype, "rBush", void 0);
|
|
30989
31078
|
|
|
30990
31079
|
PrepareRendererPlugin = PrepareRendererPlugin_1 = __decorate([singleton({
|
|
@@ -31816,7 +31905,6 @@
|
|
|
31816
31905
|
exports.decorate = inversify.decorate;
|
|
31817
31906
|
exports.deg2rad = deg2rad;
|
|
31818
31907
|
exports.deg2turn = deg2turn;
|
|
31819
|
-
exports.dirtifyToRoot = dirtifyToRoot;
|
|
31820
31908
|
exports.equalSet = equalSet;
|
|
31821
31909
|
exports.extractPolygons = extractPolygons;
|
|
31822
31910
|
exports.formatAttribute = formatAttribute;
|