@antv/g 5.0.15 → 5.0.16
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/index.umd.min.js +18 -2
- package/es/Canvas.d.ts +3 -0
- package/es/Canvas.js +8 -9
- package/es/camera/Camera.d.ts +3 -2
- package/es/camera/Camera.js +16 -8
- package/es/canvas-module.js +4 -2
- package/es/components/Transform.d.ts +0 -1
- package/es/components/Transform.js +0 -1
- package/es/display-objects/Circle.d.ts +1 -1
- package/es/display-objects/Circle.js +8 -3
- package/es/display-objects/CustomElement.d.ts +3 -2
- package/es/display-objects/CustomElement.js +9 -6
- package/es/display-objects/DisplayObject.d.ts +4 -3
- package/es/display-objects/DisplayObject.js +77 -50
- package/es/display-objects/Ellipse.d.ts +1 -1
- package/es/display-objects/Ellipse.js +8 -3
- package/es/display-objects/Group.d.ts +18 -2
- package/es/display-objects/Group.js +11 -9
- package/es/display-objects/HTML.d.ts +1 -1
- package/es/display-objects/HTML.js +9 -4
- package/es/display-objects/Image.d.ts +5 -3
- package/es/display-objects/Image.js +8 -3
- package/es/display-objects/Line.d.ts +1 -1
- package/es/display-objects/Line.js +12 -4
- package/es/display-objects/Path.d.ts +3 -2
- package/es/display-objects/Path.js +10 -5
- package/es/display-objects/Polygon.d.ts +1 -1
- package/es/display-objects/Polygon.js +9 -3
- package/es/display-objects/Polyline.d.ts +1 -1
- package/es/display-objects/Polyline.js +10 -5
- package/es/display-objects/Rect.d.ts +1 -1
- package/es/display-objects/Rect.js +8 -3
- package/es/display-objects/Text.d.ts +9 -4
- package/es/display-objects/Text.js +14 -9
- package/es/dom/Animation.js +1 -1
- package/es/dom/AnimationTimeline.js +1 -2
- package/es/dom/CustomElementRegistry.js +12 -12
- package/es/dom/Document.d.ts +1 -0
- package/es/dom/Document.js +21 -1
- package/es/dom/Element.d.ts +10 -5
- package/es/dom/Element.js +41 -15
- package/es/dom/EventTarget.d.ts +2 -2
- package/es/dom/EventTarget.js +4 -3
- package/es/dom/KeyframeList.js +1 -1
- package/es/dom/MutationEvent.d.ts +15 -0
- package/es/dom/MutationEvent.js +29 -0
- package/es/dom/MutationObserver.d.ts +36 -0
- package/es/dom/MutationObserver.js +413 -0
- package/es/dom/MutationRecord.d.ts +14 -0
- package/es/dom/MutationRecord.js +31 -0
- package/es/dom/Node.d.ts +35 -3
- package/es/dom/Node.js +184 -17
- package/es/dom/index.d.ts +3 -0
- package/es/dom/index.js +3 -0
- package/es/dom/interfaces.d.ts +36 -8
- package/es/dom/interfaces.js +23 -5
- package/es/global-module.d.ts +1 -0
- package/es/global-module.js +11 -13
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/plugins/CullingPlugin.d.ts +0 -2
- package/es/plugins/CullingPlugin.js +3 -24
- package/es/plugins/DirtyCheckPlugin.js +2 -2
- package/es/plugins/FrustumCullingStrategy.d.ts +1 -0
- package/es/plugins/FrustumCullingStrategy.js +40 -33
- package/es/plugins/PrepareRendererPlugin.js +21 -5
- package/es/property-handlers/aabb.js +19 -20
- package/es/property-handlers/color.js +5 -2
- package/es/property-handlers/dimension.d.ts +15 -3
- package/es/property-handlers/dimension.js +50 -9
- package/es/property-handlers/index.d.ts +3 -0
- package/es/property-handlers/index.js +4 -1
- package/es/property-handlers/inherit.d.ts +6 -0
- package/es/property-handlers/inherit.js +25 -0
- package/es/property-handlers/interfaces.d.ts +2 -2
- package/es/property-handlers/lineDash.d.ts +6 -1
- package/es/property-handlers/lineDash.js +23 -4
- package/es/property-handlers/offsetDistance.js +2 -2
- package/es/property-handlers/text.d.ts +2 -0
- package/es/property-handlers/text.js +3 -0
- package/es/property-handlers/textTransform.d.ts +6 -0
- package/es/property-handlers/textTransform.js +19 -0
- package/es/services/EventService.js +3 -5
- package/es/services/RenderingContext.d.ts +5 -8
- package/es/services/RenderingContext.js +6 -7
- package/es/services/RenderingService.js +2 -8
- package/es/services/SceneGraphSelector.d.ts +3 -2
- package/es/services/SceneGraphSelector.js +8 -4
- package/es/services/SceneGraphService.d.ts +0 -7
- package/es/services/SceneGraphService.js +9 -77
- package/es/services/aabb/CircleUpdater.js +3 -3
- package/es/services/aabb/EllipseUpdater.js +2 -2
- package/es/services/aabb/LineUpdater.js +2 -2
- package/es/services/aabb/PathUpdater.js +2 -2
- package/es/services/aabb/PolylineUpdater.js +3 -3
- package/es/services/aabb/RectUpdater.js +4 -4
- package/es/services/aabb/TextUpdater.js +19 -10
- package/es/services/text/index.js +19 -21
- package/es/types.d.ts +48 -24
- package/es/types.js +50 -31
- package/es/utils/custom-easing.js +1 -1
- package/es/utils/event.js +5 -3
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.js +2 -1
- package/es/utils/interpolation.d.ts +1 -0
- package/es/utils/interpolation.js +41 -8
- package/es/utils/path.js +11 -11
- package/es/utils/raf.d.ts +1 -1
- package/es/utils/raf.js +0 -2
- package/es/utils/string.d.ts +1 -0
- package/es/utils/string.js +9 -0
- package/es/utils/text.js +3 -3
- package/lib/Canvas.d.ts +3 -0
- package/lib/Canvas.js +6 -7
- package/lib/camera/Camera.d.ts +3 -2
- package/lib/camera/Camera.js +20 -10
- package/lib/canvas-module.js +3 -1
- package/lib/components/Transform.d.ts +0 -1
- package/lib/components/Transform.js +0 -1
- package/lib/display-objects/Circle.d.ts +1 -1
- package/lib/display-objects/Circle.js +7 -2
- package/lib/display-objects/CustomElement.d.ts +3 -2
- package/lib/display-objects/CustomElement.js +9 -6
- package/lib/display-objects/DisplayObject.d.ts +4 -3
- package/lib/display-objects/DisplayObject.js +76 -47
- package/lib/display-objects/Ellipse.d.ts +1 -1
- package/lib/display-objects/Ellipse.js +7 -2
- package/lib/display-objects/Group.d.ts +18 -2
- package/lib/display-objects/Group.js +10 -9
- package/lib/display-objects/HTML.d.ts +1 -1
- package/lib/display-objects/HTML.js +8 -4
- package/lib/display-objects/Image.d.ts +5 -3
- package/lib/display-objects/Image.js +7 -2
- package/lib/display-objects/Line.d.ts +1 -1
- package/lib/display-objects/Line.js +11 -3
- package/lib/display-objects/Path.d.ts +3 -2
- package/lib/display-objects/Path.js +9 -4
- package/lib/display-objects/Polygon.d.ts +1 -1
- package/lib/display-objects/Polygon.js +8 -2
- package/lib/display-objects/Polyline.d.ts +1 -1
- package/lib/display-objects/Polyline.js +9 -4
- package/lib/display-objects/Rect.d.ts +1 -1
- package/lib/display-objects/Rect.js +7 -2
- package/lib/display-objects/Text.d.ts +9 -4
- package/lib/display-objects/Text.js +13 -8
- package/lib/dom/Animation.js +1 -1
- package/lib/dom/AnimationTimeline.js +1 -2
- package/lib/dom/CustomElementRegistry.js +11 -11
- package/lib/dom/Document.d.ts +1 -0
- package/lib/dom/Document.js +22 -1
- package/lib/dom/Element.d.ts +10 -5
- package/lib/dom/Element.js +43 -15
- package/lib/dom/EventTarget.d.ts +2 -2
- package/lib/dom/EventTarget.js +4 -3
- package/lib/dom/KeyframeList.js +1 -1
- package/lib/dom/MutationEvent.d.ts +15 -0
- package/lib/dom/MutationEvent.js +37 -0
- package/lib/dom/MutationObserver.d.ts +36 -0
- package/lib/dom/MutationObserver.js +424 -0
- package/lib/dom/MutationRecord.d.ts +14 -0
- package/lib/dom/MutationRecord.js +38 -0
- package/lib/dom/Node.d.ts +35 -3
- package/lib/dom/Node.js +185 -16
- package/lib/dom/index.d.ts +3 -0
- package/lib/dom/index.js +39 -0
- package/lib/dom/interfaces.d.ts +36 -8
- package/lib/dom/interfaces.js +23 -5
- package/lib/global-module.d.ts +1 -0
- package/lib/global-module.js +12 -8
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -1
- package/lib/plugins/CullingPlugin.d.ts +0 -2
- package/lib/plugins/CullingPlugin.js +2 -23
- package/lib/plugins/DirtyCheckPlugin.js +1 -1
- package/lib/plugins/FrustumCullingStrategy.d.ts +1 -0
- package/lib/plugins/FrustumCullingStrategy.js +41 -33
- package/lib/plugins/PrepareRendererPlugin.js +24 -4
- package/lib/property-handlers/aabb.js +18 -19
- package/lib/property-handlers/color.js +6 -3
- package/lib/property-handlers/dimension.d.ts +15 -3
- package/lib/property-handlers/dimension.js +50 -8
- package/lib/property-handlers/index.d.ts +3 -0
- package/lib/property-handlers/index.js +39 -0
- package/lib/property-handlers/inherit.d.ts +6 -0
- package/lib/property-handlers/inherit.js +34 -0
- package/lib/property-handlers/interfaces.d.ts +2 -2
- package/lib/property-handlers/lineDash.d.ts +6 -1
- package/lib/property-handlers/lineDash.js +25 -4
- package/lib/property-handlers/offsetDistance.js +1 -1
- package/lib/property-handlers/text.d.ts +2 -0
- package/lib/property-handlers/text.js +10 -0
- package/lib/property-handlers/textTransform.d.ts +6 -0
- package/lib/property-handlers/textTransform.js +27 -0
- package/lib/services/EventService.js +3 -5
- package/lib/services/RenderingContext.d.ts +5 -8
- package/lib/services/RenderingContext.js +8 -9
- package/lib/services/RenderingService.js +1 -7
- package/lib/services/SceneGraphSelector.d.ts +3 -2
- package/lib/services/SceneGraphSelector.js +10 -3
- package/lib/services/SceneGraphService.d.ts +0 -7
- package/lib/services/SceneGraphService.js +10 -77
- package/lib/services/aabb/CircleUpdater.js +2 -2
- package/lib/services/aabb/EllipseUpdater.js +1 -1
- package/lib/services/aabb/LineUpdater.js +1 -1
- package/lib/services/aabb/PathUpdater.js +1 -1
- package/lib/services/aabb/PolylineUpdater.js +2 -2
- package/lib/services/aabb/RectUpdater.js +3 -3
- package/lib/services/aabb/TextUpdater.js +18 -9
- package/lib/services/text/index.js +19 -21
- package/lib/types.d.ts +48 -24
- package/lib/types.js +56 -35
- package/lib/utils/custom-easing.js +1 -1
- package/lib/utils/event.js +5 -3
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +13 -0
- package/lib/utils/interpolation.d.ts +1 -0
- package/lib/utils/interpolation.js +43 -7
- package/lib/utils/path.js +10 -10
- package/lib/utils/raf.d.ts +1 -1
- package/lib/utils/raf.js +0 -2
- package/lib/utils/string.d.ts +1 -0
- package/lib/utils/string.js +16 -0
- package/lib/utils/text.js +3 -3
- package/package.json +5 -3
package/lib/dom/Node.js
CHANGED
|
@@ -7,8 +7,12 @@ exports.Node = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _tslib = require("tslib");
|
|
9
9
|
|
|
10
|
+
var _ = require("..");
|
|
11
|
+
|
|
10
12
|
var _EventTarget = require("./EventTarget");
|
|
11
13
|
|
|
14
|
+
// import { Text } from '../display-objects/Text';
|
|
15
|
+
|
|
12
16
|
/**
|
|
13
17
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Node
|
|
14
18
|
*/
|
|
@@ -63,11 +67,6 @@ function (_super) {
|
|
|
63
67
|
*/
|
|
64
68
|
|
|
65
69
|
_this.nodeValue = null;
|
|
66
|
-
/**
|
|
67
|
-
* @see https://developer.mozilla.org/zh-CN/docs/Web/API/Node/textContent
|
|
68
|
-
*/
|
|
69
|
-
|
|
70
|
-
_this.textContent = null;
|
|
71
70
|
/**
|
|
72
71
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/ParentNode
|
|
73
72
|
*/
|
|
@@ -79,20 +78,86 @@ function (_super) {
|
|
|
79
78
|
Node.isNode = function (target) {
|
|
80
79
|
return !!target.childNodes;
|
|
81
80
|
};
|
|
81
|
+
|
|
82
|
+
Object.defineProperty(Node.prototype, "textContent", {
|
|
83
|
+
/**
|
|
84
|
+
* @see https://developer.mozilla.org/zh-CN/docs/Web/API/Node/textContent
|
|
85
|
+
*/
|
|
86
|
+
get: function get() {
|
|
87
|
+
var e_1, _a;
|
|
88
|
+
|
|
89
|
+
var out = '';
|
|
90
|
+
|
|
91
|
+
if (this.nodeName === _.Shape.TEXT) {
|
|
92
|
+
// @ts-ignore
|
|
93
|
+
out += this.style.text;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
try {
|
|
97
|
+
for (var _b = (0, _tslib.__values)(this.childNodes), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
98
|
+
var child = _c.value;
|
|
99
|
+
|
|
100
|
+
if (child.nodeName === _.Shape.TEXT) {
|
|
101
|
+
out += child.nodeValue;
|
|
102
|
+
} else {
|
|
103
|
+
out += child.textContent;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
} catch (e_1_1) {
|
|
107
|
+
e_1 = {
|
|
108
|
+
error: e_1_1
|
|
109
|
+
};
|
|
110
|
+
} finally {
|
|
111
|
+
try {
|
|
112
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
113
|
+
} finally {
|
|
114
|
+
if (e_1) throw e_1.error;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return out;
|
|
119
|
+
},
|
|
120
|
+
set: function set(content) {
|
|
121
|
+
var _this = this; // remove all children
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
this.childNodes.slice().forEach(function (child) {
|
|
125
|
+
_this.removeChild(child, true);
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
if (this.nodeName === _.Shape.TEXT) {
|
|
129
|
+
// @ts-ignore
|
|
130
|
+
this.style.text = "".concat(content);
|
|
131
|
+
} else {// this.appendChild(
|
|
132
|
+
// new Text({
|
|
133
|
+
// style: {
|
|
134
|
+
// text: content,
|
|
135
|
+
// },
|
|
136
|
+
// }),
|
|
137
|
+
// );
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
enumerable: false,
|
|
141
|
+
configurable: true
|
|
142
|
+
});
|
|
82
143
|
/**
|
|
83
144
|
* @see https://developer.mozilla.org/zh-CN/docs/Web/API/Node/getRootNode
|
|
84
145
|
*/
|
|
85
146
|
|
|
147
|
+
Node.prototype.getRootNode = function (opts) {
|
|
148
|
+
if (opts === void 0) {
|
|
149
|
+
opts = {};
|
|
150
|
+
}
|
|
86
151
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
152
|
+
if (this.parentNode) {
|
|
153
|
+
return this.parentNode.getRootNode(opts);
|
|
154
|
+
}
|
|
90
155
|
|
|
91
|
-
|
|
92
|
-
|
|
156
|
+
if (opts.composed && this.host) {
|
|
157
|
+
return this.host.getRootNode(opts);
|
|
93
158
|
}
|
|
94
159
|
|
|
95
|
-
return
|
|
160
|
+
return this;
|
|
96
161
|
};
|
|
97
162
|
|
|
98
163
|
Node.prototype.hasChildNodes = function () {
|
|
@@ -105,11 +170,6 @@ function (_super) {
|
|
|
105
170
|
}; // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
106
171
|
|
|
107
172
|
|
|
108
|
-
Node.prototype.compareDocumentPosition = function (other) {
|
|
109
|
-
throw new Error('Method not implemented.');
|
|
110
|
-
}; // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
111
|
-
|
|
112
|
-
|
|
113
173
|
Node.prototype.lookupNamespaceURI = function (prefix) {
|
|
114
174
|
throw new Error('Method not implemented.');
|
|
115
175
|
}; // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -182,11 +242,89 @@ function (_super) {
|
|
|
182
242
|
enumerable: false,
|
|
183
243
|
configurable: true
|
|
184
244
|
});
|
|
245
|
+
/**
|
|
246
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition
|
|
247
|
+
* @see https://github.com/b-fuze/deno-dom/blob/master/src/dom/node.ts#L338
|
|
248
|
+
*/
|
|
249
|
+
|
|
250
|
+
Node.prototype.compareDocumentPosition = function (other) {
|
|
251
|
+
var _a;
|
|
252
|
+
|
|
253
|
+
if (other === this) {
|
|
254
|
+
// same node
|
|
255
|
+
return 0;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
if (!(other instanceof Node)) {
|
|
259
|
+
throw new TypeError('Node.compareDocumentPosition: Argument 1 does not implement interface Node.');
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
var node1Root = other; // eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
263
|
+
|
|
264
|
+
var node2Root = this;
|
|
265
|
+
var node1Hierarchy = [node1Root];
|
|
266
|
+
var node2Hierarchy = [node2Root];
|
|
267
|
+
|
|
268
|
+
while ((_a = node1Root.parentNode) !== null && _a !== void 0 ? _a : node2Root.parentNode) {
|
|
269
|
+
node1Root = node1Root.parentNode ? (node1Hierarchy.push(node1Root.parentNode), node1Root.parentNode) : node1Root;
|
|
270
|
+
node2Root = node2Root.parentNode ? (node2Hierarchy.push(node2Root.parentNode), node2Root.parentNode) : node2Root;
|
|
271
|
+
} // Check if they don't share the same root node
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
if (node1Root !== node2Root) {
|
|
275
|
+
return Node.DOCUMENT_POSITION_DISCONNECTED | Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC | Node.DOCUMENT_POSITION_PRECEDING;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
var longerHierarchy = node1Hierarchy.length > node2Hierarchy.length ? node1Hierarchy : node2Hierarchy;
|
|
279
|
+
var shorterHierarchy = longerHierarchy === node1Hierarchy ? node2Hierarchy : node1Hierarchy; // Check if either is a container of the other
|
|
280
|
+
|
|
281
|
+
if (longerHierarchy[longerHierarchy.length - shorterHierarchy.length] === shorterHierarchy[0]) {
|
|
282
|
+
return longerHierarchy === node1Hierarchy ? // other is a child of this
|
|
283
|
+
Node.DOCUMENT_POSITION_CONTAINED_BY | Node.DOCUMENT_POSITION_FOLLOWING : // this is a child of other
|
|
284
|
+
Node.DOCUMENT_POSITION_CONTAINS | Node.DOCUMENT_POSITION_PRECEDING;
|
|
285
|
+
} // Find their first common ancestor and see whether they
|
|
286
|
+
// are preceding or following
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
var longerStart = longerHierarchy.length - shorterHierarchy.length;
|
|
290
|
+
|
|
291
|
+
for (var i = shorterHierarchy.length - 1; i >= 0; i--) {
|
|
292
|
+
var shorterHierarchyNode = shorterHierarchy[i];
|
|
293
|
+
var longerHierarchyNode = longerHierarchy[longerStart + i]; // We found the first common ancestor
|
|
294
|
+
|
|
295
|
+
if (longerHierarchyNode !== shorterHierarchyNode) {
|
|
296
|
+
var siblings = shorterHierarchyNode.parentNode.childNodes;
|
|
297
|
+
|
|
298
|
+
if (siblings.indexOf(shorterHierarchyNode) < siblings.indexOf(longerHierarchyNode)) {
|
|
299
|
+
// Shorter is before longer
|
|
300
|
+
if (shorterHierarchy === node1Hierarchy) {
|
|
301
|
+
// Other is before this
|
|
302
|
+
return Node.DOCUMENT_POSITION_PRECEDING;
|
|
303
|
+
} else {
|
|
304
|
+
// This is before other
|
|
305
|
+
return Node.DOCUMENT_POSITION_FOLLOWING;
|
|
306
|
+
}
|
|
307
|
+
} else {
|
|
308
|
+
// Longer is before shorter
|
|
309
|
+
if (longerHierarchy === node1Hierarchy) {
|
|
310
|
+
// Other is before this
|
|
311
|
+
return Node.DOCUMENT_POSITION_PRECEDING;
|
|
312
|
+
} else {
|
|
313
|
+
// Other is after this
|
|
314
|
+
return Node.DOCUMENT_POSITION_FOLLOWING;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
return Node.DOCUMENT_POSITION_FOLLOWING;
|
|
321
|
+
};
|
|
185
322
|
/**
|
|
186
323
|
* @deprecated
|
|
187
324
|
* @alias contains
|
|
188
325
|
*/
|
|
189
326
|
|
|
327
|
+
|
|
190
328
|
Node.prototype.contain = function (other) {
|
|
191
329
|
return this.contains(other);
|
|
192
330
|
};
|
|
@@ -221,7 +359,38 @@ function (_super) {
|
|
|
221
359
|
});
|
|
222
360
|
}
|
|
223
361
|
};
|
|
362
|
+
/**
|
|
363
|
+
* Both nodes are in different documents or different trees in the same document.
|
|
364
|
+
*/
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
Node.DOCUMENT_POSITION_DISCONNECTED = 1;
|
|
368
|
+
/**
|
|
369
|
+
* otherNode precedes the node in either a pre-order depth-first traversal
|
|
370
|
+
* of a tree containing both (e.g., as an ancestor or previous sibling or a descendant of a previous sibling or previous sibling of an ancestor) or (if they are disconnected) in an arbitrary but consistent ordering.
|
|
371
|
+
*/
|
|
372
|
+
|
|
373
|
+
Node.DOCUMENT_POSITION_PRECEDING = 2;
|
|
374
|
+
/**
|
|
375
|
+
* otherNode follows the node in either a pre-order depth-first traversal of a tree containing both (e.g., as a descendant or following sibling or a descendant of a following sibling or following sibling of an ancestor) or (if they are disconnected) in an arbitrary but consistent ordering.
|
|
376
|
+
*/
|
|
377
|
+
|
|
378
|
+
Node.DOCUMENT_POSITION_FOLLOWING = 4;
|
|
379
|
+
/**
|
|
380
|
+
* otherNode is an ancestor of the node.
|
|
381
|
+
*/
|
|
382
|
+
|
|
383
|
+
Node.DOCUMENT_POSITION_CONTAINS = 8;
|
|
384
|
+
/**
|
|
385
|
+
* otherNode is a descendant of the node.
|
|
386
|
+
*/
|
|
387
|
+
|
|
388
|
+
Node.DOCUMENT_POSITION_CONTAINED_BY = 16;
|
|
389
|
+
/**
|
|
390
|
+
* The result relies upon arbitrary and/or implementation-specific behavior and is not guaranteed to be portable.
|
|
391
|
+
*/
|
|
224
392
|
|
|
393
|
+
Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 32;
|
|
225
394
|
return Node;
|
|
226
395
|
}(_EventTarget.EventTarget);
|
|
227
396
|
|
package/lib/dom/index.d.ts
CHANGED
|
@@ -11,6 +11,9 @@ export * from './Animation';
|
|
|
11
11
|
export * from './AnimationEvent';
|
|
12
12
|
export * from './AnimationEffectTiming';
|
|
13
13
|
export * from './CustomEvent';
|
|
14
|
+
export * from './MutationEvent';
|
|
15
|
+
export * from './MutationObserver';
|
|
16
|
+
export * from './MutationRecord';
|
|
14
17
|
export * from './KeyframeEffect';
|
|
15
18
|
export * from './KeyframeList';
|
|
16
19
|
export * from './AnimationTimeline';
|
package/lib/dom/index.js
CHANGED
|
@@ -173,6 +173,45 @@ Object.keys(_CustomEvent).forEach(function (key) {
|
|
|
173
173
|
});
|
|
174
174
|
});
|
|
175
175
|
|
|
176
|
+
var _MutationEvent = require("./MutationEvent");
|
|
177
|
+
|
|
178
|
+
Object.keys(_MutationEvent).forEach(function (key) {
|
|
179
|
+
if (key === "default" || key === "__esModule") return;
|
|
180
|
+
if (key in exports && exports[key] === _MutationEvent[key]) return;
|
|
181
|
+
Object.defineProperty(exports, key, {
|
|
182
|
+
enumerable: true,
|
|
183
|
+
get: function get() {
|
|
184
|
+
return _MutationEvent[key];
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
var _MutationObserver = require("./MutationObserver");
|
|
190
|
+
|
|
191
|
+
Object.keys(_MutationObserver).forEach(function (key) {
|
|
192
|
+
if (key === "default" || key === "__esModule") return;
|
|
193
|
+
if (key in exports && exports[key] === _MutationObserver[key]) return;
|
|
194
|
+
Object.defineProperty(exports, key, {
|
|
195
|
+
enumerable: true,
|
|
196
|
+
get: function get() {
|
|
197
|
+
return _MutationObserver[key];
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
var _MutationRecord = require("./MutationRecord");
|
|
203
|
+
|
|
204
|
+
Object.keys(_MutationRecord).forEach(function (key) {
|
|
205
|
+
if (key === "default" || key === "__esModule") return;
|
|
206
|
+
if (key in exports && exports[key] === _MutationRecord[key]) return;
|
|
207
|
+
Object.defineProperty(exports, key, {
|
|
208
|
+
enumerable: true,
|
|
209
|
+
get: function get() {
|
|
210
|
+
return _MutationRecord[key];
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
|
|
176
215
|
var _KeyframeEffect = require("./KeyframeEffect");
|
|
177
216
|
|
|
178
217
|
Object.keys(_KeyframeEffect).forEach(function (key) {
|
package/lib/dom/interfaces.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type EventEmitter from 'eventemitter3';
|
|
2
2
|
import type { AnimationTimeline } from './AnimationTimeline';
|
|
3
|
-
import type { BaseStyleProps,
|
|
3
|
+
import type { BaseStyleProps, Shape } from '../types';
|
|
4
4
|
import type { FederatedEvent } from './FederatedEvent';
|
|
5
5
|
import type { CustomElementRegistry } from './CustomElementRegistry';
|
|
6
6
|
import type { DisplayObject } from '..';
|
|
@@ -9,28 +9,43 @@ import type { Camera } from '../camera';
|
|
|
9
9
|
import type { ContextService } from '../services';
|
|
10
10
|
/**
|
|
11
11
|
* built-in events for element
|
|
12
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/MutationEvent
|
|
13
|
+
*
|
|
14
|
+
* TODO: use MutationObserver instead
|
|
15
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver
|
|
12
16
|
*/
|
|
13
17
|
export declare enum ElementEvent {
|
|
14
18
|
DESTROY = "destroy",
|
|
15
|
-
|
|
19
|
+
/**
|
|
20
|
+
* @see https://www.w3.org/TR/DOM-Level-3-Events/#event-type-DOMAttrModified
|
|
21
|
+
*/
|
|
22
|
+
ATTR_MODIFIED = "DOMAttrModified",
|
|
16
23
|
/**
|
|
17
24
|
* it has been inserted
|
|
25
|
+
* @see https://www.w3.org/TR/DOM-Level-3-Events/#event-type-DOMNodeInserted
|
|
18
26
|
*/
|
|
19
|
-
INSERTED = "
|
|
27
|
+
INSERTED = "DOMNodeInserted",
|
|
20
28
|
/**
|
|
21
29
|
* it has had a child inserted
|
|
22
30
|
*/
|
|
23
31
|
CHILD_INSERTED = "child-inserted",
|
|
24
32
|
/**
|
|
25
|
-
* it
|
|
33
|
+
* it is being removed
|
|
34
|
+
* @see https://www.w3.org/TR/DOM-Level-3-Events/#event-type-DOMNodeRemoved
|
|
26
35
|
*/
|
|
27
36
|
REMOVED = "removed",
|
|
28
37
|
/**
|
|
29
38
|
* it has had a child removed
|
|
30
39
|
*/
|
|
31
40
|
CHILD_REMOVED = "child-removed",
|
|
32
|
-
|
|
33
|
-
|
|
41
|
+
/**
|
|
42
|
+
* @see https://www.w3.org/TR/DOM-Level-3-Events/#domnodeinsertedintodocument
|
|
43
|
+
*/
|
|
44
|
+
MOUNTED = "DOMNodeInsertedIntoDocument",
|
|
45
|
+
/**
|
|
46
|
+
* @see https://www.w3.org/TR/DOM-Level-3-Events/#domnoderemovedfromdocument
|
|
47
|
+
*/
|
|
48
|
+
UNMOUNTED = "DOMNodeRemovedFromDocument",
|
|
34
49
|
BOUNDS_CHANGED = "bounds-changed",
|
|
35
50
|
/**
|
|
36
51
|
* trigger when z-index changed
|
|
@@ -222,6 +237,10 @@ export interface DisplayObjectConfig<StyleProps> {
|
|
|
222
237
|
*/
|
|
223
238
|
id?: string;
|
|
224
239
|
name?: string;
|
|
240
|
+
/**
|
|
241
|
+
* @see https://developer.mozilla.org/zh-CN/docs/Web/API/Element/className
|
|
242
|
+
*/
|
|
243
|
+
class?: string;
|
|
225
244
|
className?: string;
|
|
226
245
|
/**
|
|
227
246
|
* all styles properties, not read-only
|
|
@@ -234,7 +253,7 @@ export interface DisplayObjectConfig<StyleProps> {
|
|
|
234
253
|
* @deprecated
|
|
235
254
|
*/
|
|
236
255
|
attrs?: StyleProps;
|
|
237
|
-
type?:
|
|
256
|
+
type?: Shape | string;
|
|
238
257
|
/**
|
|
239
258
|
* @deprecated use `style.zIndex` instead
|
|
240
259
|
*/
|
|
@@ -276,7 +295,7 @@ export interface IElement<StyleProps = any, ParsedStyleProps = any> extends INod
|
|
|
276
295
|
* compatible with `style`
|
|
277
296
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style
|
|
278
297
|
*/
|
|
279
|
-
style: StyleProps
|
|
298
|
+
style: StyleProps & ICSSStyleDeclaration<StyleProps>;
|
|
280
299
|
parsedStyle: ParsedStyleProps;
|
|
281
300
|
getElementById: <E extends IElement = IElement>(id: string) => E | null;
|
|
282
301
|
getElementsByName: <E extends IElement = IElement>(name: string) => E[];
|
|
@@ -313,6 +332,15 @@ export interface IDocument extends INode, IParentNode {
|
|
|
313
332
|
*/
|
|
314
333
|
createElement: <T extends DisplayObject<StyleProps>, StyleProps extends BaseStyleProps>(tagName: string, options: DisplayObjectConfig<StyleProps>) => T;
|
|
315
334
|
}
|
|
335
|
+
/**
|
|
336
|
+
* @see https://developer.mozilla.org/zh-CN/docs/Web/API/CSSStyleDeclaration
|
|
337
|
+
*/
|
|
338
|
+
export interface ICSSStyleDeclaration<StyleProps> {
|
|
339
|
+
setProperty: <Key extends keyof StyleProps>(propertyName: Key, value: StyleProps[Key], priority?: string) => void;
|
|
340
|
+
getPropertyValue: (propertyName: keyof StyleProps) => StyleProps[keyof StyleProps] | undefined;
|
|
341
|
+
removeProperty: (propertyName: keyof StyleProps) => void;
|
|
342
|
+
item: (index: number) => string;
|
|
343
|
+
}
|
|
316
344
|
export interface ICanvas extends IEventTarget {
|
|
317
345
|
document: IDocument;
|
|
318
346
|
customElements: CustomElementRegistry;
|
package/lib/dom/interfaces.js
CHANGED
|
@@ -7,25 +7,35 @@ exports.ElementEvent = void 0;
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* built-in events for element
|
|
10
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/MutationEvent
|
|
11
|
+
*
|
|
12
|
+
* TODO: use MutationObserver instead
|
|
13
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver
|
|
10
14
|
*/
|
|
11
15
|
var ElementEvent;
|
|
12
16
|
exports.ElementEvent = ElementEvent;
|
|
13
17
|
|
|
14
18
|
(function (ElementEvent) {
|
|
15
19
|
ElementEvent["DESTROY"] = "destroy";
|
|
16
|
-
|
|
20
|
+
/**
|
|
21
|
+
* @see https://www.w3.org/TR/DOM-Level-3-Events/#event-type-DOMAttrModified
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
ElementEvent["ATTR_MODIFIED"] = "DOMAttrModified";
|
|
17
25
|
/**
|
|
18
26
|
* it has been inserted
|
|
27
|
+
* @see https://www.w3.org/TR/DOM-Level-3-Events/#event-type-DOMNodeInserted
|
|
19
28
|
*/
|
|
20
29
|
|
|
21
|
-
ElementEvent["INSERTED"] = "
|
|
30
|
+
ElementEvent["INSERTED"] = "DOMNodeInserted";
|
|
22
31
|
/**
|
|
23
32
|
* it has had a child inserted
|
|
24
33
|
*/
|
|
25
34
|
|
|
26
35
|
ElementEvent["CHILD_INSERTED"] = "child-inserted";
|
|
27
36
|
/**
|
|
28
|
-
* it
|
|
37
|
+
* it is being removed
|
|
38
|
+
* @see https://www.w3.org/TR/DOM-Level-3-Events/#event-type-DOMNodeRemoved
|
|
29
39
|
*/
|
|
30
40
|
|
|
31
41
|
ElementEvent["REMOVED"] = "removed";
|
|
@@ -34,8 +44,16 @@ exports.ElementEvent = ElementEvent;
|
|
|
34
44
|
*/
|
|
35
45
|
|
|
36
46
|
ElementEvent["CHILD_REMOVED"] = "child-removed";
|
|
37
|
-
|
|
38
|
-
|
|
47
|
+
/**
|
|
48
|
+
* @see https://www.w3.org/TR/DOM-Level-3-Events/#domnodeinsertedintodocument
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
ElementEvent["MOUNTED"] = "DOMNodeInsertedIntoDocument";
|
|
52
|
+
/**
|
|
53
|
+
* @see https://www.w3.org/TR/DOM-Level-3-Events/#domnoderemovedfromdocument
|
|
54
|
+
*/
|
|
55
|
+
|
|
56
|
+
ElementEvent["UNMOUNTED"] = "DOMNodeRemovedFromDocument";
|
|
39
57
|
ElementEvent["BOUNDS_CHANGED"] = "bounds-changed";
|
|
40
58
|
/**
|
|
41
59
|
* trigger when z-index changed
|
package/lib/global-module.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Interpolatable, StylePropertyParser, StylePropertyMerger, StylePropertyUpdater } from './property-handlers';
|
|
2
2
|
export declare const globalContainer: import("mana-syringe").Container;
|
|
3
|
+
export declare const INHERIT_PROPERTIES: string[];
|
|
3
4
|
export declare const stylePropertyParserFactory: Record<string, StylePropertyParser<any, any>>;
|
|
4
5
|
export declare const stylePropertyUpdaterFactory: Record<string, StylePropertyUpdater<any>[]>;
|
|
5
6
|
export declare const stylePropertyMergerFactory: Record<string, StylePropertyMerger<any, any>>;
|
package/lib/global-module.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.INHERIT_PROPERTIES = void 0;
|
|
6
7
|
exports.addPropertiesHandler = addPropertiesHandler;
|
|
7
8
|
exports.addPropertyHandler = addPropertyHandler;
|
|
8
9
|
exports.stylePropertyUpdaterFactory = exports.stylePropertyParserFactory = exports.stylePropertyMergerFactory = exports.globalContainer = exports.containerModule = void 0;
|
|
@@ -27,8 +28,11 @@ var _SceneGraphSelector = require("./services/SceneGraphSelector");
|
|
|
27
28
|
|
|
28
29
|
var _propertyHandlers = require("./property-handlers");
|
|
29
30
|
|
|
30
|
-
var globalContainer = _manaSyringe.GlobalContainer;
|
|
31
|
+
var globalContainer = _manaSyringe.GlobalContainer; // some properties support 'inherit' value
|
|
32
|
+
|
|
31
33
|
exports.globalContainer = globalContainer;
|
|
34
|
+
var INHERIT_PROPERTIES = ['textAlign', 'fontSize', 'fontFamily', 'fontWeight', 'fontStyle'];
|
|
35
|
+
exports.INHERIT_PROPERTIES = INHERIT_PROPERTIES;
|
|
32
36
|
var stylePropertyParserFactory = {};
|
|
33
37
|
exports.stylePropertyParserFactory = stylePropertyParserFactory;
|
|
34
38
|
var stylePropertyUpdaterFactory = {};
|
|
@@ -65,10 +69,7 @@ var containerModule = (0, _manaSyringe.Module)(function (register) {
|
|
|
65
69
|
|
|
66
70
|
register(_DisplayObjectPool.DisplayObjectPool); // bind Selector
|
|
67
71
|
|
|
68
|
-
register(
|
|
69
|
-
token: _SceneGraphSelector.SceneGraphSelector,
|
|
70
|
-
useClass: _SceneGraphSelector.DefaultSceneGraphSelector
|
|
71
|
-
});
|
|
72
|
+
register(_SceneGraphSelector.DefaultSceneGraphSelector);
|
|
72
73
|
register({
|
|
73
74
|
token: _SceneGraphSelector.SceneGraphSelectorFactory,
|
|
74
75
|
useFactory: function useFactory(context) {
|
|
@@ -110,13 +111,14 @@ var containerModule = (0, _manaSyringe.Module)(function (register) {
|
|
|
110
111
|
}); // bind handlers for properties
|
|
111
112
|
|
|
112
113
|
addPropertiesHandler(['opacity', 'fillOpacity', 'strokeOpacity', 'offsetDistance'], _propertyHandlers.parseNumber, (0, _propertyHandlers.clampedMergeNumbers)(0, 1), undefined);
|
|
113
|
-
addPropertiesHandler(['
|
|
114
|
+
addPropertiesHandler(['shadowBlur'], _propertyHandlers.parseNumber, (0, _propertyHandlers.clampedMergeNumbers)(0, Infinity), undefined); // support percent
|
|
114
115
|
|
|
115
|
-
addPropertiesHandler(['r', 'rx', 'ry', 'width', 'height'], _propertyHandlers.parseLengthOrPercent, // @ts-ignore
|
|
116
|
+
addPropertiesHandler(['r', 'rx', 'ry', 'width', 'height', 'fontSize', 'lineWidth', 'dx', 'dy'], _propertyHandlers.parseLengthOrPercent, // @ts-ignore
|
|
116
117
|
_propertyHandlers.mergeDimensions, undefined);
|
|
117
118
|
addPropertiesHandler(['lineDash'], _propertyHandlers.parseLineDash, // @ts-ignore
|
|
118
119
|
_propertyHandlers.mergeNumberLists, undefined);
|
|
119
120
|
addPropertiesHandler(['x1', 'x2', 'y1', 'y2', 'lineDashOffset', 'shadowOffsetX', 'shadowOffsetY'], _propertyHandlers.parseNumber, _propertyHandlers.mergeNumbers, undefined);
|
|
121
|
+
addPropertiesHandler(INHERIT_PROPERTIES, undefined, undefined, _propertyHandlers.updateInherit);
|
|
120
122
|
addPropertiesHandler(['x1', 'x2', 'y1', 'y2', 'r', 'rx', 'ry', 'width', 'height', 'path', 'points', 'text', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY', 'lineWidth', 'filter', 'font', 'fontSize', 'fontFamily', 'fontStyle', 'fontWeight', 'fontVariant', 'lineHeight', 'letterSpacing', // 'padding',
|
|
121
123
|
'wordWrap', 'wordWrapWidth', 'leading', 'textBaseline', 'textAlign', 'whiteSpace'], undefined, undefined, _propertyHandlers.updateGeometry);
|
|
122
124
|
addPropertiesHandler(['fill', 'stroke', 'shadowColor'], _propertyHandlers.parseColor, _propertyHandlers.mergeColors, undefined);
|
|
@@ -128,7 +130,9 @@ var containerModule = (0, _manaSyringe.Module)(function (register) {
|
|
|
128
130
|
|
|
129
131
|
addPropertyHandler('transformOrigin', undefined, undefined, _propertyHandlers.updateTransformOrigin); // @ts-ignore
|
|
130
132
|
|
|
131
|
-
addPropertyHandler('transform', _propertyHandlers.parseTransform, _propertyHandlers.mergeTransforms, _propertyHandlers.updateTransform);
|
|
133
|
+
addPropertyHandler('transform', _propertyHandlers.parseTransform, _propertyHandlers.mergeTransforms, _propertyHandlers.updateTransform);
|
|
134
|
+
addPropertyHandler('text', undefined, undefined, _propertyHandlers.updateText);
|
|
135
|
+
addPropertyHandler('textTransform', undefined, undefined, _propertyHandlers.updateTextTransform); // Path.path
|
|
132
136
|
// @ts-ignore
|
|
133
137
|
|
|
134
138
|
addPropertyHandler('path', _propertyHandlers.parsePath, _propertyHandlers.mergePaths, undefined); // Polyline.points Polygon.points
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -10,6 +10,8 @@ var _exportNames = {
|
|
|
10
10
|
};
|
|
11
11
|
exports.ManaSyringe = void 0;
|
|
12
12
|
|
|
13
|
+
require("reflect-metadata");
|
|
14
|
+
|
|
13
15
|
var ManaSyringe = _interopRequireWildcard(require("mana-syringe"));
|
|
14
16
|
|
|
15
17
|
exports.ManaSyringe = ManaSyringe;
|
|
@@ -12,8 +12,6 @@ export interface CullingStrategyContribution {
|
|
|
12
12
|
*/
|
|
13
13
|
export declare class CullingPlugin implements RenderingPlugin {
|
|
14
14
|
static tag: string;
|
|
15
|
-
private canvasConfig;
|
|
16
15
|
private strategyProvider;
|
|
17
|
-
private renderingContext;
|
|
18
16
|
apply(renderingService: RenderingService): void;
|
|
19
17
|
}
|
|
@@ -11,10 +11,6 @@ var _manaSyringe = require("mana-syringe");
|
|
|
11
11
|
|
|
12
12
|
var _RenderingService = require("../services/RenderingService");
|
|
13
13
|
|
|
14
|
-
var _RenderingContext = require("../services/RenderingContext");
|
|
15
|
-
|
|
16
|
-
var _types = require("../types");
|
|
17
|
-
|
|
18
14
|
var CullingStrategyContribution = _manaSyringe.Syringe.defineToken('CullingStrategyContribution');
|
|
19
15
|
/**
|
|
20
16
|
* apply following rules:
|
|
@@ -33,8 +29,6 @@ function () {
|
|
|
33
29
|
CullingPlugin_1 = CullingPlugin;
|
|
34
30
|
|
|
35
31
|
CullingPlugin.prototype.apply = function (renderingService) {
|
|
36
|
-
var _this = this;
|
|
37
|
-
|
|
38
32
|
var strategies = this.strategyProvider.getContributions();
|
|
39
33
|
renderingService.hooks.prepare.tap(CullingPlugin_1.tag, function (object) {
|
|
40
34
|
if (object) {
|
|
@@ -51,22 +45,9 @@ function () {
|
|
|
51
45
|
|
|
52
46
|
if (object.isVisible()) {
|
|
53
47
|
return object;
|
|
54
|
-
} else {
|
|
55
|
-
// Those invisible objects which get renderred in last frame should be saved for later use.
|
|
56
|
-
var enableDirtyRectangleRendering = _this.canvasConfig.renderer.getConfig().enableDirtyRectangleRendering;
|
|
57
|
-
|
|
58
|
-
if (enableDirtyRectangleRendering) {
|
|
59
|
-
var removedRenderBounds = object.getRenderBounds();
|
|
60
|
-
|
|
61
|
-
if (removedRenderBounds) {
|
|
62
|
-
_this.renderingContext.removedRenderBoundsList.push(removedRenderBounds);
|
|
63
|
-
|
|
64
|
-
_this.renderingContext.renderReasons.add(_RenderingContext.RENDER_REASON.DisplayObjectRemoved);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return null;
|
|
69
48
|
}
|
|
49
|
+
|
|
50
|
+
return null;
|
|
70
51
|
}
|
|
71
52
|
|
|
72
53
|
return object;
|
|
@@ -78,9 +59,7 @@ function () {
|
|
|
78
59
|
|
|
79
60
|
var CullingPlugin_1;
|
|
80
61
|
CullingPlugin.tag = 'CullingPlugin';
|
|
81
|
-
(0, _tslib.__decorate)([(0, _manaSyringe.inject)(_types.CanvasConfig), (0, _tslib.__metadata)("design:type", Object)], CullingPlugin.prototype, "canvasConfig", void 0);
|
|
82
62
|
(0, _tslib.__decorate)([(0, _manaSyringe.contrib)(CullingStrategyContribution), (0, _tslib.__metadata)("design:type", Object)], CullingPlugin.prototype, "strategyProvider", void 0);
|
|
83
|
-
(0, _tslib.__decorate)([(0, _manaSyringe.inject)(_RenderingContext.RenderingContext), (0, _tslib.__metadata)("design:type", Object)], CullingPlugin.prototype, "renderingContext", void 0);
|
|
84
63
|
CullingPlugin = CullingPlugin_1 = (0, _tslib.__decorate)([(0, _manaSyringe.singleton)({
|
|
85
64
|
contrib: _RenderingService.RenderingPluginContribution
|
|
86
65
|
})], CullingPlugin);
|
|
@@ -34,7 +34,7 @@ function () {
|
|
|
34
34
|
|
|
35
35
|
var renderable = object.renderable;
|
|
36
36
|
|
|
37
|
-
var isDirty = renderable.dirty || _this.renderingContext.renderReasons.has(_RenderingContext.
|
|
37
|
+
var isDirty = renderable.dirty || _this.renderingContext.renderReasons.has(_RenderingContext.RenderReason.CAMERA_CHANGED);
|
|
38
38
|
|
|
39
39
|
if (isDirty || !enableDirtyRectangleRendering) {
|
|
40
40
|
return object;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CullingStrategyContribution } from './CullingPlugin';
|
|
2
2
|
import type { DisplayObject } from '../display-objects/DisplayObject';
|
|
3
3
|
export declare class FrustumCullingStrategy implements CullingStrategyContribution {
|
|
4
|
+
private camera;
|
|
4
5
|
isVisible(object: DisplayObject): boolean;
|
|
5
6
|
/**
|
|
6
7
|
*
|