@antv/g 5.0.22 → 5.0.23-alpha.11
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 +3 -3
- package/es/AbstractRenderer.js +5 -0
- package/es/camera/Camera.js +2 -2
- package/es/css/StyleValueRegistry.d.ts +2 -0
- package/es/css/StyleValueRegistry.js +7 -3
- package/es/css/cssom/CSSKeywordValue.d.ts +1 -1
- package/es/css/cssom/CSSNumericSumValue.d.ts +1 -1
- package/es/css/cssom/CSSNumericValue.d.ts +141 -4
- package/es/css/cssom/CSSNumericValue.js +1166 -5
- package/es/css/cssom/CSSTransformValue.d.ts +1 -1
- package/es/css/cssom/index.d.ts +0 -10
- package/es/css/cssom/index.js +1 -11
- package/es/css/parser/color.js +1 -1
- package/es/css/parser/dimension.js +1 -2
- package/es/css/parser/numeric.d.ts +1 -1
- package/es/css/parser/numeric.js +2 -2
- package/es/css/parser/path.d.ts +2 -2
- package/es/css/parser/path.js +1 -1
- package/es/css/parser/points.js +1 -1
- package/es/css/parser/transform-origin.d.ts +1 -1
- package/es/css/parser/transform-origin.js +2 -2
- package/es/css/parser/transform.d.ts +1 -3
- package/es/css/parser/transform.js +9 -8
- package/es/css/properties/CSSPropertyPath.d.ts +14 -2
- package/es/css/properties/CSSPropertyTextTransform.d.ts +2 -2
- package/es/css/properties/CSSPropertyTransform.js +3 -4
- package/es/display-objects/DisplayObject.js +4 -5
- package/es/display-objects/Path.d.ts +15 -15
- package/es/display-objects/Path.js +1 -1
- package/es/display-objects/Polygon.d.ts +8 -1
- package/es/display-objects/Polyline.d.ts +7 -5
- package/es/dom/Document.js +2 -2
- package/es/dom/Element.js +1 -2
- package/es/dom/EventTarget.js +1 -1
- package/es/dom/FederatedTouchEvent.d.ts +5 -3
- package/es/plugins/CullingPlugin.d.ts +0 -1
- package/es/plugins/CullingPlugin.js +3 -8
- package/es/plugins/DirtyCheckPlugin.d.ts +1 -1
- package/es/plugins/DirtyCheckPlugin.js +9 -8
- package/es/plugins/EventPlugin.d.ts +1 -1
- package/es/plugins/EventPlugin.js +163 -148
- package/es/plugins/PrepareRendererPlugin.d.ts +0 -1
- package/es/plugins/PrepareRendererPlugin.js +17 -18
- package/es/services/EventService.d.ts +8 -0
- package/es/services/EventService.js +274 -20
- package/es/services/RenderingService.d.ts +17 -16
- package/es/services/RenderingService.js +20 -19
- package/es/services/SceneGraphService.js +1 -1
- package/es/services/aabb/PathUpdater.d.ts +3 -3
- package/es/services/aabb/PolylineUpdater.d.ts +3 -3
- package/es/services/aabb/RectUpdater.js +1 -1
- package/es/types.d.ts +5 -3
- package/es/utils/assert.d.ts +6 -0
- package/es/utils/assert.js +18 -0
- package/es/utils/event.d.ts +18 -16
- package/es/utils/hooks.d.ts +280 -0
- package/es/utils/hooks.js +753 -0
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.js +2 -1
- package/es/utils/math.d.ts +1 -0
- package/es/utils/math.js +13 -2
- package/es/utils/string.d.ts +1 -0
- package/es/utils/string.js +8 -0
- package/es/utils/text.js +2 -1
- package/lib/AbstractRenderer.js +5 -0
- package/lib/camera/Camera.js +4 -4
- package/lib/css/StyleValueRegistry.d.ts +2 -0
- package/lib/css/StyleValueRegistry.js +13 -5
- package/lib/css/cssom/CSSKeywordValue.d.ts +1 -1
- package/lib/css/cssom/CSSNumericSumValue.d.ts +1 -1
- package/lib/css/cssom/CSSNumericValue.d.ts +141 -4
- package/lib/css/cssom/CSSNumericValue.js +1226 -52
- package/lib/css/cssom/CSSTransformValue.d.ts +1 -1
- package/lib/css/cssom/index.d.ts +0 -10
- package/lib/css/cssom/index.js +0 -130
- package/lib/css/parser/color.js +5 -5
- package/lib/css/parser/dimension.js +1 -3
- package/lib/css/parser/numeric.d.ts +1 -1
- package/lib/css/parser/numeric.js +7 -7
- package/lib/css/parser/path.d.ts +2 -2
- package/lib/css/parser/path.js +4 -4
- package/lib/css/parser/points.js +2 -2
- package/lib/css/parser/transform-origin.d.ts +1 -1
- package/lib/css/parser/transform-origin.js +4 -4
- package/lib/css/parser/transform.d.ts +1 -3
- package/lib/css/parser/transform.js +25 -24
- package/lib/css/properties/CSSPropertyPath.d.ts +14 -2
- package/lib/css/properties/CSSPropertyTextTransform.d.ts +2 -2
- package/lib/css/properties/CSSPropertyTransform.js +18 -20
- package/lib/display-objects/DisplayObject.js +7 -9
- package/lib/display-objects/Path.d.ts +15 -15
- package/lib/display-objects/Path.js +3 -3
- package/lib/display-objects/Polygon.d.ts +8 -1
- package/lib/display-objects/Polyline.d.ts +7 -5
- package/lib/dom/Document.js +2 -2
- package/lib/dom/Element.js +1 -3
- package/lib/dom/EventTarget.js +9 -9
- package/lib/dom/FederatedTouchEvent.d.ts +5 -3
- package/lib/plugins/CullingPlugin.d.ts +0 -1
- package/lib/plugins/CullingPlugin.js +3 -7
- package/lib/plugins/DirtyCheckPlugin.d.ts +1 -1
- package/lib/plugins/DirtyCheckPlugin.js +10 -8
- package/lib/plugins/EventPlugin.d.ts +1 -1
- package/lib/plugins/EventPlugin.js +172 -156
- package/lib/plugins/PrepareRendererPlugin.d.ts +0 -1
- package/lib/plugins/PrepareRendererPlugin.js +16 -16
- package/lib/services/EventService.d.ts +8 -0
- package/lib/services/EventService.js +274 -19
- package/lib/services/RenderingService.d.ts +17 -16
- package/lib/services/RenderingService.js +21 -20
- package/lib/services/SceneGraphService.js +3 -3
- package/lib/services/aabb/PathUpdater.d.ts +3 -3
- package/lib/services/aabb/PolylineUpdater.d.ts +3 -3
- package/lib/services/aabb/RectUpdater.js +3 -3
- package/lib/types.d.ts +5 -3
- package/lib/utils/assert.d.ts +6 -0
- package/lib/utils/assert.js +30 -0
- package/lib/utils/event.d.ts +18 -16
- package/lib/utils/hooks.d.ts +280 -0
- package/lib/utils/hooks.js +759 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +13 -0
- package/lib/utils/math.d.ts +1 -0
- package/lib/utils/math.js +17 -4
- package/lib/utils/string.d.ts +1 -0
- package/lib/utils/string.js +11 -0
- package/lib/utils/text.js +5 -3
- package/package.json +4 -7
- package/es/css/cssom/CSSMathInvert.d.ts +0 -14
- package/es/css/cssom/CSSMathInvert.js +0 -84
- package/es/css/cssom/CSSMathMax.d.ts +0 -17
- package/es/css/cssom/CSSMathMax.js +0 -118
- package/es/css/cssom/CSSMathMin.d.ts +0 -17
- package/es/css/cssom/CSSMathMin.js +0 -119
- package/es/css/cssom/CSSMathNegate.d.ts +0 -14
- package/es/css/cssom/CSSMathNegate.js +0 -80
- package/es/css/cssom/CSSMathProduct.d.ts +0 -16
- package/es/css/cssom/CSSMathProduct.js +0 -109
- package/es/css/cssom/CSSMathSum.d.ts +0 -17
- package/es/css/cssom/CSSMathSum.js +0 -117
- package/es/css/cssom/CSSMathValue.d.ts +0 -11
- package/es/css/cssom/CSSMathValue.js +0 -27
- package/es/css/cssom/CSSMathVariadic.d.ts +0 -9
- package/es/css/cssom/CSSMathVariadic.js +0 -44
- package/es/css/cssom/CSSNumericValueType.d.ts +0 -33
- package/es/css/cssom/CSSNumericValueType.js +0 -259
- package/es/css/cssom/CSSUnitValue.d.ts +0 -33
- package/es/css/cssom/CSSUnitValue.js +0 -252
- package/lib/css/cssom/CSSMathInvert.d.ts +0 -14
- package/lib/css/cssom/CSSMathInvert.js +0 -94
- package/lib/css/cssom/CSSMathMax.d.ts +0 -17
- package/lib/css/cssom/CSSMathMax.js +0 -128
- package/lib/css/cssom/CSSMathMin.d.ts +0 -17
- package/lib/css/cssom/CSSMathMin.js +0 -128
- package/lib/css/cssom/CSSMathNegate.d.ts +0 -14
- package/lib/css/cssom/CSSMathNegate.js +0 -89
- package/lib/css/cssom/CSSMathProduct.d.ts +0 -16
- package/lib/css/cssom/CSSMathProduct.js +0 -119
- package/lib/css/cssom/CSSMathSum.d.ts +0 -17
- package/lib/css/cssom/CSSMathSum.js +0 -129
- package/lib/css/cssom/CSSMathValue.d.ts +0 -11
- package/lib/css/cssom/CSSMathValue.js +0 -35
- package/lib/css/cssom/CSSMathVariadic.d.ts +0 -9
- package/lib/css/cssom/CSSMathVariadic.js +0 -55
- package/lib/css/cssom/CSSNumericValueType.d.ts +0 -33
- package/lib/css/cssom/CSSNumericValueType.js +0 -272
- package/lib/css/cssom/CSSUnitValue.d.ts +0 -33
- package/lib/css/cssom/CSSUnitValue.js +0 -267
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BaseStyleProps, PathCommand } from '../types';
|
|
1
|
+
import type { BaseStyleProps, PathCommand, ParsedBaseStyleProps } from '../types';
|
|
2
2
|
import { DisplayObject } from './DisplayObject';
|
|
3
3
|
import type { DisplayObjectConfig } from '../dom';
|
|
4
4
|
import { Point } from '../shapes';
|
|
@@ -16,21 +16,21 @@ export interface PathSegment {
|
|
|
16
16
|
endTangent: [number, number] | null;
|
|
17
17
|
params: PathCommand;
|
|
18
18
|
}
|
|
19
|
-
export interface ParsedPathStyleProps {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
19
|
+
export interface ParsedPathStyleProps extends ParsedBaseStyleProps {
|
|
20
|
+
path: {
|
|
21
|
+
absolutePath: PathCommand[];
|
|
22
|
+
hasArc: boolean;
|
|
23
|
+
segments: PathSegment[];
|
|
24
|
+
polygons: [number, number][][];
|
|
25
|
+
polylines: [number, number][][];
|
|
26
|
+
curve: PathCommand[];
|
|
27
|
+
totalLength: number;
|
|
28
|
+
curveSegments: number[][];
|
|
29
|
+
zCommandIndexes: number[];
|
|
30
|
+
rect: Rectangle;
|
|
31
|
+
};
|
|
30
32
|
}
|
|
31
|
-
export declare class Path extends DisplayObject<PathStyleProps, {
|
|
32
|
-
path: ParsedPathStyleProps;
|
|
33
|
-
}> {
|
|
33
|
+
export declare class Path extends DisplayObject<PathStyleProps, ParsedPathStyleProps> {
|
|
34
34
|
constructor({ style, ...rest }?: DisplayObjectConfig<PathStyleProps>);
|
|
35
35
|
getTotalLength(): number;
|
|
36
36
|
/**
|
|
@@ -9,14 +9,14 @@ var _tslib = require("tslib");
|
|
|
9
9
|
|
|
10
10
|
var _gMath = require("@antv/g-math");
|
|
11
11
|
|
|
12
|
-
var _lodashEs = require("lodash-es");
|
|
13
|
-
|
|
14
12
|
var _types = require("../types");
|
|
15
13
|
|
|
16
14
|
var _DisplayObject = require("./DisplayObject");
|
|
17
15
|
|
|
18
16
|
var _shapes = require("../shapes");
|
|
19
17
|
|
|
18
|
+
var _utils = require("../utils");
|
|
19
|
+
|
|
20
20
|
var Path =
|
|
21
21
|
/** @class */
|
|
22
22
|
function (_super) {
|
|
@@ -68,7 +68,7 @@ function (_super) {
|
|
|
68
68
|
});
|
|
69
69
|
var seg = curve[index];
|
|
70
70
|
|
|
71
|
-
if ((0,
|
|
71
|
+
if ((0, _utils.isNil)(seg) || (0, _utils.isNil)(index)) {
|
|
72
72
|
return null;
|
|
73
73
|
}
|
|
74
74
|
|
|
@@ -4,6 +4,13 @@ import type { DisplayObjectConfig } from '../dom';
|
|
|
4
4
|
export interface PolygonStyleProps extends BaseStyleProps {
|
|
5
5
|
points: [number, number][];
|
|
6
6
|
}
|
|
7
|
-
export
|
|
7
|
+
export interface ParsedPolygonStyleProps extends ParsedBaseStyleProps {
|
|
8
|
+
points: {
|
|
9
|
+
points: [number, number][];
|
|
10
|
+
segments: [number, number][];
|
|
11
|
+
totalLength: number;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export declare class Polygon extends DisplayObject<PolygonStyleProps, ParsedPolygonStyleProps> {
|
|
8
15
|
constructor({ style, ...rest }?: DisplayObjectConfig<PolygonStyleProps>);
|
|
9
16
|
}
|
|
@@ -5,12 +5,14 @@ import { Point } from '../shapes';
|
|
|
5
5
|
export interface PolylineStyleProps extends BaseStyleProps {
|
|
6
6
|
points: [number, number][];
|
|
7
7
|
}
|
|
8
|
-
export interface ParsedPolylineStyleProps {
|
|
9
|
-
points:
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
export interface ParsedPolylineStyleProps extends ParsedBaseStyleProps {
|
|
9
|
+
points: {
|
|
10
|
+
points: [number, number][];
|
|
11
|
+
segments: [number, number][];
|
|
12
|
+
totalLength: number;
|
|
13
|
+
};
|
|
12
14
|
}
|
|
13
|
-
export declare class Polyline extends DisplayObject<PolylineStyleProps,
|
|
15
|
+
export declare class Polyline extends DisplayObject<PolylineStyleProps, ParsedPolylineStyleProps> {
|
|
14
16
|
constructor({ style, ...rest }?: DisplayObjectConfig<PolylineStyleProps>);
|
|
15
17
|
getTotalLength(): number;
|
|
16
18
|
getPoint(ratio: number): Point;
|
package/lib/dom/Document.js
CHANGED
|
@@ -159,7 +159,7 @@ function (_super) {
|
|
|
159
159
|
}), clientX = _c.x, clientY = _c.y;
|
|
160
160
|
return [4
|
|
161
161
|
/*yield*/
|
|
162
|
-
, this.defaultView.getRenderingService().hooks.pick.
|
|
162
|
+
, this.defaultView.getRenderingService().hooks.pick.callPromise({
|
|
163
163
|
topmost: true,
|
|
164
164
|
position: {
|
|
165
165
|
x: x,
|
|
@@ -213,7 +213,7 @@ function (_super) {
|
|
|
213
213
|
}), clientX = _c.x, clientY = _c.y;
|
|
214
214
|
return [4
|
|
215
215
|
/*yield*/
|
|
216
|
-
, this.defaultView.getRenderingService().hooks.pick.
|
|
216
|
+
, this.defaultView.getRenderingService().hooks.pick.callPromise({
|
|
217
217
|
topmost: false,
|
|
218
218
|
position: {
|
|
219
219
|
x: x,
|
package/lib/dom/Element.js
CHANGED
|
@@ -9,8 +9,6 @@ var _tslib = require("tslib");
|
|
|
9
9
|
|
|
10
10
|
var _manaSyringe = require("mana-syringe");
|
|
11
11
|
|
|
12
|
-
var _lodashEs = require("lodash-es");
|
|
13
|
-
|
|
14
12
|
var _SceneGraphService = require("../services/SceneGraphService");
|
|
15
13
|
|
|
16
14
|
var _components = require("../components");
|
|
@@ -533,7 +531,7 @@ function (_super) {
|
|
|
533
531
|
|
|
534
532
|
var value = this.attributes[attributeName]; // if the given attribute does not exist, the value returned will either be null or ""
|
|
535
533
|
|
|
536
|
-
return (0,
|
|
534
|
+
return (0, _utils.isNil)(value) ? null : value;
|
|
537
535
|
};
|
|
538
536
|
/**
|
|
539
537
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/hasAttribute
|
package/lib/dom/EventTarget.js
CHANGED
|
@@ -7,14 +7,14 @@ exports.EventTarget = exports.DELEGATION_SPLITTER = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _tslib = require("tslib");
|
|
9
9
|
|
|
10
|
-
var _lodashEs = require("lodash-es");
|
|
11
|
-
|
|
12
10
|
var _eventemitter = require("eventemitter3");
|
|
13
11
|
|
|
14
12
|
var _CustomEvent = require("./CustomEvent");
|
|
15
13
|
|
|
16
14
|
var _FederatedEvent = require("./FederatedEvent");
|
|
17
15
|
|
|
16
|
+
var _utils = require("../utils");
|
|
17
|
+
|
|
18
18
|
var DELEGATION_SPLITTER = ':';
|
|
19
19
|
/**
|
|
20
20
|
* Objects that can receive events and may have listeners for them.
|
|
@@ -50,9 +50,9 @@ function () {
|
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
EventTarget.prototype.addEventListener = function (type, listener, options) {
|
|
53
|
-
var capture = (0,
|
|
54
|
-
var once = (0,
|
|
55
|
-
var context = (0,
|
|
53
|
+
var capture = (0, _utils.isBoolean)(options) && options || (0, _utils.isObject)(options) && options.capture;
|
|
54
|
+
var once = (0, _utils.isObject)(options) && options.once;
|
|
55
|
+
var context = (0, _utils.isFunction)(listener) ? undefined : listener; // compatible with G 3.0
|
|
56
56
|
// support using delegate name in event type, eg. 'node:click'
|
|
57
57
|
|
|
58
58
|
var useDelegatedName = false;
|
|
@@ -69,7 +69,7 @@ function () {
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
type = capture ? "".concat(type, "capture") : type;
|
|
72
|
-
listener = (0,
|
|
72
|
+
listener = (0, _utils.isFunction)(listener) ? listener : listener.handleEvent; // compatible with G 3.0
|
|
73
73
|
|
|
74
74
|
if (useDelegatedName) {
|
|
75
75
|
var originListener_1 = listener;
|
|
@@ -122,10 +122,10 @@ function () {
|
|
|
122
122
|
};
|
|
123
123
|
|
|
124
124
|
EventTarget.prototype.removeEventListener = function (type, listener, options) {
|
|
125
|
-
var capture = (0,
|
|
126
|
-
var context = (0,
|
|
125
|
+
var capture = (0, _utils.isBoolean)(options) && options || (0, _utils.isObject)(options) && options.capture;
|
|
126
|
+
var context = (0, _utils.isFunction)(listener) ? undefined : listener;
|
|
127
127
|
type = capture ? "".concat(type, "capture") : type;
|
|
128
|
-
listener = (0,
|
|
128
|
+
listener = (0, _utils.isFunction)(listener) ? listener : listener === null || listener === void 0 ? void 0 : listener.handleEvent;
|
|
129
129
|
this.emitter.off(type, listener, context);
|
|
130
130
|
return this;
|
|
131
131
|
};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import type { FormattedTouch } from '../utils';
|
|
1
2
|
import { FederatedEvent } from './FederatedEvent';
|
|
2
3
|
/**
|
|
3
4
|
* @see https://w3c.github.io/touch-events/#touchevent-interface
|
|
4
5
|
*/
|
|
5
6
|
export declare class FederatedTouchEvent extends FederatedEvent<MouseEvent | PointerEvent | TouchEvent> implements TouchEvent {
|
|
7
|
+
pointerType: string;
|
|
6
8
|
altKey: boolean;
|
|
7
9
|
ctrlKey: boolean;
|
|
8
10
|
metaKey: boolean;
|
|
9
11
|
shiftKey: boolean;
|
|
10
|
-
changedTouches:
|
|
11
|
-
targetTouches:
|
|
12
|
-
touches:
|
|
12
|
+
changedTouches: FormattedTouch[];
|
|
13
|
+
targetTouches: FormattedTouch[];
|
|
14
|
+
touches: FormattedTouch[];
|
|
13
15
|
}
|
|
@@ -11,7 +11,6 @@ export interface CullingStrategyContribution {
|
|
|
11
11
|
* 2. other custom culling strategies, eg. frustum culling
|
|
12
12
|
*/
|
|
13
13
|
export declare class CullingPlugin implements RenderingPlugin {
|
|
14
|
-
static tag: string;
|
|
15
14
|
private strategyProvider;
|
|
16
15
|
apply(renderingService: RenderingService): void;
|
|
17
16
|
}
|
|
@@ -26,11 +26,9 @@ var CullingPlugin =
|
|
|
26
26
|
function () {
|
|
27
27
|
function CullingPlugin() {}
|
|
28
28
|
|
|
29
|
-
CullingPlugin_1 = CullingPlugin;
|
|
30
|
-
|
|
31
29
|
CullingPlugin.prototype.apply = function (renderingService) {
|
|
32
30
|
var strategies = this.strategyProvider.getContributions();
|
|
33
|
-
renderingService.hooks.cull.tap(
|
|
31
|
+
renderingService.hooks.cull.tap(function (object) {
|
|
34
32
|
if (object) {
|
|
35
33
|
var cullable = object.cullable;
|
|
36
34
|
|
|
@@ -52,15 +50,13 @@ function () {
|
|
|
52
50
|
|
|
53
51
|
return object;
|
|
54
52
|
});
|
|
55
|
-
renderingService.hooks.afterRender.tap(
|
|
53
|
+
renderingService.hooks.afterRender.tap(function (object) {
|
|
56
54
|
object.cullable.visibilityPlaneMask = -1;
|
|
57
55
|
});
|
|
58
56
|
};
|
|
59
57
|
|
|
60
|
-
var CullingPlugin_1;
|
|
61
|
-
CullingPlugin.tag = 'CullingPlugin';
|
|
62
58
|
(0, _tslib.__decorate)([(0, _manaSyringe.contrib)(CullingStrategyContribution), (0, _tslib.__metadata)("design:type", Object)], CullingPlugin.prototype, "strategyProvider", void 0);
|
|
63
|
-
CullingPlugin =
|
|
59
|
+
CullingPlugin = (0, _tslib.__decorate)([(0, _manaSyringe.singleton)({
|
|
64
60
|
contrib: _RenderingService.RenderingPluginContribution
|
|
65
61
|
})], CullingPlugin);
|
|
66
62
|
return CullingPlugin;
|
|
@@ -3,7 +3,7 @@ import type { RenderingService, RenderingPlugin } from '../services/RenderingSer
|
|
|
3
3
|
* Filter dirty renderables and calculate the "dirty rectangle" which will be clear when frame began
|
|
4
4
|
*/
|
|
5
5
|
export declare class DirtyCheckPlugin implements RenderingPlugin {
|
|
6
|
-
|
|
6
|
+
private canvasConfig;
|
|
7
7
|
private renderingContext;
|
|
8
8
|
apply(renderingService: RenderingService): void;
|
|
9
9
|
}
|
|
@@ -9,6 +9,8 @@ var _tslib = require("tslib");
|
|
|
9
9
|
|
|
10
10
|
var _manaSyringe = require("mana-syringe");
|
|
11
11
|
|
|
12
|
+
var _types = require("../types");
|
|
13
|
+
|
|
12
14
|
var _RenderingService = require("../services/RenderingService");
|
|
13
15
|
|
|
14
16
|
var _RenderingContext = require("../services/RenderingContext");
|
|
@@ -21,18 +23,19 @@ var DirtyCheckPlugin =
|
|
|
21
23
|
function () {
|
|
22
24
|
function DirtyCheckPlugin() {}
|
|
23
25
|
|
|
24
|
-
DirtyCheckPlugin_1 = DirtyCheckPlugin;
|
|
25
|
-
|
|
26
26
|
DirtyCheckPlugin.prototype.apply = function (renderingService) {
|
|
27
27
|
var _this = this;
|
|
28
28
|
|
|
29
|
-
renderingService.hooks.dirtycheck.tap(
|
|
29
|
+
renderingService.hooks.dirtycheck.tap(function (object) {
|
|
30
30
|
if (object) {
|
|
31
|
-
|
|
31
|
+
var enableDirtyCheck = _this.canvasConfig.renderer.getConfig().enableDirtyCheck;
|
|
32
|
+
|
|
32
33
|
var renderable = object.renderable;
|
|
33
34
|
|
|
34
|
-
var
|
|
35
|
+
var isCameraDirty = _this.renderingContext.renderReasons.has(_RenderingContext.RenderReason.CAMERA_CHANGED);
|
|
35
36
|
|
|
37
|
+
var isRenderingContextDirty = _this.renderingContext.dirty;
|
|
38
|
+
var isDirty = renderable.dirty || isCameraDirty || (enableDirtyCheck ? false : isRenderingContextDirty);
|
|
36
39
|
|
|
37
40
|
if (isDirty) {
|
|
38
41
|
return object;
|
|
@@ -45,10 +48,9 @@ function () {
|
|
|
45
48
|
});
|
|
46
49
|
};
|
|
47
50
|
|
|
48
|
-
|
|
49
|
-
DirtyCheckPlugin.tag = 'DirtyCheckPlugin';
|
|
51
|
+
(0, _tslib.__decorate)([(0, _manaSyringe.inject)(_types.CanvasConfig), (0, _tslib.__metadata)("design:type", Object)], DirtyCheckPlugin.prototype, "canvasConfig", void 0);
|
|
50
52
|
(0, _tslib.__decorate)([(0, _manaSyringe.inject)(_RenderingContext.RenderingContext), (0, _tslib.__metadata)("design:type", Object)], DirtyCheckPlugin.prototype, "renderingContext", void 0);
|
|
51
|
-
DirtyCheckPlugin =
|
|
53
|
+
DirtyCheckPlugin = (0, _tslib.__decorate)([(0, _manaSyringe.singleton)({
|
|
52
54
|
contrib: _RenderingService.RenderingPluginContribution
|
|
53
55
|
})], DirtyCheckPlugin);
|
|
54
56
|
return DirtyCheckPlugin;
|
|
@@ -7,7 +7,6 @@ import { RenderingService } from '../services';
|
|
|
7
7
|
* also provide some extra events such as `drag`
|
|
8
8
|
*/
|
|
9
9
|
export declare class EventPlugin implements RenderingPlugin {
|
|
10
|
-
static tag: string;
|
|
11
10
|
private canvasConfig;
|
|
12
11
|
private contextService;
|
|
13
12
|
private renderingService;
|
|
@@ -18,6 +17,7 @@ export declare class EventPlugin implements RenderingPlugin {
|
|
|
18
17
|
private rootWheelEvent;
|
|
19
18
|
apply(renderingService: RenderingService): void;
|
|
20
19
|
private onPointerMove;
|
|
20
|
+
private formatTouch;
|
|
21
21
|
private bootstrapEvent;
|
|
22
22
|
private normalizeWheelEvent;
|
|
23
23
|
/**
|