@visactor/vrender-core 0.20.0-alpha.0 → 0.20.0-alpha.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/cjs/allocator/matrix-allocate.d.ts +1 -1
- package/cjs/allocator/matrix-allocate.js +2 -4
- package/cjs/allocator/matrix-allocate.js.map +1 -1
- package/cjs/animate/animate.js +4 -2
- package/cjs/animate/animate.js.map +1 -1
- package/cjs/animate/custom-animate.d.ts +5 -16
- package/cjs/animate/custom-animate.js +9 -62
- package/cjs/animate/custom-animate.js.map +1 -1
- package/cjs/animate/group-fade.d.ts +16 -0
- package/cjs/animate/group-fade.js +66 -0
- package/cjs/animate/group-fade.js.map +1 -0
- package/cjs/animate/index.d.ts +1 -0
- package/cjs/animate/index.js +2 -1
- package/cjs/animate/index.js.map +1 -1
- package/cjs/canvas/util.d.ts +0 -1
- package/cjs/canvas/util.js +7 -17
- package/cjs/canvas/util.js.map +1 -1
- package/cjs/common/3d-interceptor.d.ts +3 -0
- package/cjs/common/3d-interceptor.js +51 -0
- package/cjs/common/3d-interceptor.js.map +1 -0
- package/cjs/common/bezier-utils.js +2 -1
- package/cjs/common/bounds-context.js +1 -2
- package/cjs/common/canvas-utils.d.ts +1 -1
- package/cjs/common/canvas-utils.js +15 -30
- package/cjs/common/canvas-utils.js.map +1 -1
- package/cjs/common/matrix.d.ts +11 -3
- package/cjs/common/matrix.js +97 -19
- package/cjs/common/matrix.js.map +1 -1
- package/cjs/common/morphing-utils.js +1 -1
- package/cjs/common/path-svg.js +1 -1
- package/cjs/common/polygon.js +2 -2
- package/cjs/common/rect-utils.js +1 -1
- package/cjs/common/render-area.js +1 -1
- package/cjs/common/render-command-list.js +1 -1
- package/cjs/common/render-curve.js +23 -33
- package/cjs/common/render-curve.js.map +1 -1
- package/cjs/common/render-utils.js +2 -1
- package/cjs/common/seg-context.js +1 -1
- package/cjs/common/simplify.js +1 -1
- package/cjs/common/sort.js +16 -13
- package/cjs/common/sort.js.map +1 -1
- package/cjs/common/split-path.js +1 -1
- package/cjs/common/store.js +1 -1
- package/cjs/common/text.d.ts +0 -2
- package/cjs/common/text.js +4 -11
- package/cjs/common/text.js.map +1 -1
- package/cjs/common/utils.js +1 -1
- package/cjs/common/utils.js.map +1 -1
- package/cjs/core/application.js +1 -2
- package/cjs/core/camera.js +4 -4
- package/cjs/core/camera.js.map +1 -1
- package/cjs/core/constants.js +1 -1
- package/cjs/core/core-modules.js +1 -1
- package/cjs/core/global-module.js +0 -2
- package/cjs/core/global.js +1 -1
- package/cjs/core/graphic-utils.js +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/layer-service.js +1 -1
- package/cjs/core/layer.js +1 -1
- package/cjs/core/light.js +1 -1
- package/cjs/core/stage.js +15 -9
- package/cjs/core/stage.js.map +1 -1
- package/cjs/core/window.js +1 -1
- package/cjs/graphic/builtin-symbol/utils.js +1 -5
- package/cjs/graphic/builtin-symbol/utils.js.map +1 -1
- package/cjs/graphic/config.js +1 -0
- package/cjs/graphic/config.js.map +1 -1
- package/cjs/graphic/graphic-service/graphic-service.d.ts +2 -8
- package/cjs/graphic/graphic-service/graphic-service.js +17 -107
- package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
- package/cjs/graphic/richtext/utils.js +12 -21
- package/cjs/graphic/richtext/utils.js.map +1 -1
- package/cjs/graphic/richtext.d.ts +1 -1
- package/cjs/graphic/richtext.js +2 -2
- package/cjs/graphic/richtext.js.map +1 -1
- package/cjs/graphic/text.js +1 -1
- package/cjs/graphic/text.js.map +1 -1
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +3 -3
- package/cjs/index.js.map +1 -1
- package/cjs/interface/graphic/group.d.ts +1 -1
- package/cjs/interface/graphic/group.js.map +1 -1
- package/cjs/interface/graphic/richText.d.ts +1 -0
- package/cjs/interface/graphic/richText.js.map +1 -1
- package/cjs/picker/pick-interceptor.d.ts +1 -1
- package/cjs/picker/pick-interceptor.js +2 -42
- package/cjs/picker/pick-interceptor.js.map +1 -1
- package/cjs/picker/picker-service.js +4 -5
- package/cjs/picker/picker-service.js.map +1 -1
- package/cjs/plugins/builtin-plugin/edit-module.d.ts +22 -0
- package/cjs/plugins/builtin-plugin/edit-module.js +94 -0
- package/cjs/plugins/builtin-plugin/edit-module.js.map +1 -0
- package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +1 -1
- package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/react-attribute-plugin.d.ts +2 -1
- package/cjs/plugins/builtin-plugin/react-attribute-plugin.js +15 -7
- package/cjs/plugins/builtin-plugin/react-attribute-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/richtext-edit-plugin.d.ts +76 -0
- package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js +338 -0
- package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -0
- package/cjs/render/contributions/render/arc-render.js +1 -4
- package/cjs/render/contributions/render/arc-render.js.map +1 -1
- package/cjs/render/contributions/render/area-render.js +1 -1
- package/cjs/render/contributions/render/area-render.js.map +1 -1
- package/cjs/render/contributions/render/base-3d-render.d.ts +10 -0
- package/cjs/render/contributions/render/base-3d-render.js +63 -0
- package/cjs/render/contributions/render/base-3d-render.js.map +1 -0
- package/cjs/render/contributions/render/base-render.js +5 -5
- package/cjs/render/contributions/render/base-render.js.map +1 -1
- package/cjs/render/contributions/render/draw-interceptor.js +7 -51
- package/cjs/render/contributions/render/draw-interceptor.js.map +1 -1
- package/cjs/render/contributions/render/group-render.js +4 -5
- package/cjs/render/contributions/render/group-render.js.map +1 -1
- package/cjs/render/contributions/render/pyramid3d-render.d.ts +3 -5
- package/cjs/render/contributions/render/pyramid3d-render.js +4 -54
- package/cjs/render/contributions/render/pyramid3d-render.js.map +1 -1
- package/cjs/render/contributions/render/rect3d-render.d.ts +3 -5
- package/cjs/render/contributions/render/rect3d-render.js +4 -53
- package/cjs/render/contributions/render/rect3d-render.js.map +1 -1
- package/cjs/render/contributions/render/symbol-render.js +9 -18
- package/cjs/render/contributions/render/symbol-render.js.map +1 -1
- package/cjs/render/contributions/render/utils.js +2 -5
- package/cjs/render/contributions/render/utils.js.map +1 -1
- package/dist/index.es.js +1288 -978
- package/es/allocator/matrix-allocate.d.ts +1 -1
- package/es/allocator/matrix-allocate.js +3 -3
- package/es/allocator/matrix-allocate.js.map +1 -1
- package/es/animate/animate.js +4 -2
- package/es/animate/animate.js.map +1 -1
- package/es/animate/custom-animate.d.ts +5 -16
- package/es/animate/custom-animate.js +9 -58
- package/es/animate/custom-animate.js.map +1 -1
- package/es/animate/group-fade.d.ts +16 -0
- package/es/animate/group-fade.js +56 -0
- package/es/animate/group-fade.js.map +1 -0
- package/es/animate/index.d.ts +1 -0
- package/es/animate/index.js +2 -0
- package/es/animate/index.js.map +1 -1
- package/es/canvas/util.d.ts +0 -1
- package/es/canvas/util.js +7 -17
- package/es/canvas/util.js.map +1 -1
- package/es/common/3d-interceptor.d.ts +3 -0
- package/es/common/3d-interceptor.js +47 -0
- package/es/common/3d-interceptor.js.map +1 -0
- package/es/common/bezier-utils.js +2 -1
- package/es/common/bounds-context.js +1 -2
- package/es/common/canvas-utils.d.ts +1 -1
- package/es/common/canvas-utils.js +15 -30
- package/es/common/canvas-utils.js.map +1 -1
- package/es/common/matrix.d.ts +11 -3
- package/es/common/matrix.js +90 -17
- package/es/common/matrix.js.map +1 -1
- package/es/common/morphing-utils.js +1 -1
- package/es/common/path-svg.js +1 -1
- package/es/common/polygon.js +1 -1
- package/es/common/rect-utils.js +1 -1
- package/es/common/render-area.js +1 -1
- package/es/common/render-command-list.js +1 -1
- package/es/common/render-curve.js +23 -33
- package/es/common/render-curve.js.map +1 -1
- package/es/common/render-utils.js +2 -1
- package/es/common/seg-context.js +1 -1
- package/es/common/simplify.js +1 -1
- package/es/common/sort.js +16 -13
- package/es/common/sort.js.map +1 -1
- package/es/common/split-path.js +1 -1
- package/es/common/store.js +1 -1
- package/es/common/text.d.ts +0 -2
- package/es/common/text.js +1 -7
- package/es/common/text.js.map +1 -1
- package/es/common/utils.js +1 -1
- package/es/common/utils.js.map +1 -1
- package/es/core/application.js +1 -2
- package/es/core/camera.js +6 -4
- package/es/core/camera.js.map +1 -1
- package/es/core/constants.js +1 -1
- package/es/core/core-modules.js +1 -1
- package/es/core/global-module.js +0 -2
- package/es/core/global.js +1 -1
- package/es/core/graphic-utils.js +1 -1
- package/es/core/index.js +1 -1
- package/es/core/layer-service.js +1 -1
- package/es/core/layer.js +1 -1
- package/es/core/light.js +1 -1
- package/es/core/stage.js +15 -9
- package/es/core/stage.js.map +1 -1
- package/es/core/window.js +1 -1
- package/es/graphic/builtin-symbol/utils.js +1 -4
- package/es/graphic/builtin-symbol/utils.js.map +1 -1
- package/es/graphic/config.js +1 -0
- package/es/graphic/config.js.map +1 -1
- package/es/graphic/graphic-service/graphic-service.d.ts +2 -8
- package/es/graphic/graphic-service/graphic-service.js +9 -97
- package/es/graphic/graphic-service/graphic-service.js.map +1 -1
- package/es/graphic/richtext/utils.js +9 -20
- package/es/graphic/richtext/utils.js.map +1 -1
- package/es/graphic/richtext.d.ts +1 -1
- package/es/graphic/richtext.js +2 -2
- package/es/graphic/richtext.js.map +1 -1
- package/es/graphic/text.js +2 -2
- package/es/graphic/text.js.map +1 -1
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -0
- package/es/index.js.map +1 -1
- package/es/interface/graphic/group.d.ts +1 -1
- package/es/interface/graphic/group.js.map +1 -1
- package/es/interface/graphic/richText.d.ts +1 -0
- package/es/interface/graphic/richText.js.map +1 -1
- package/es/picker/pick-interceptor.d.ts +1 -1
- package/es/picker/pick-interceptor.js +4 -44
- package/es/picker/pick-interceptor.js.map +1 -1
- package/es/picker/picker-service.js +1 -1
- package/es/picker/picker-service.js.map +1 -1
- package/es/plugins/builtin-plugin/edit-module.d.ts +22 -0
- package/es/plugins/builtin-plugin/edit-module.js +86 -0
- package/es/plugins/builtin-plugin/edit-module.js.map +1 -0
- package/es/plugins/builtin-plugin/html-attribute-plugin.js +1 -1
- package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/react-attribute-plugin.d.ts +2 -1
- package/es/plugins/builtin-plugin/react-attribute-plugin.js +15 -7
- package/es/plugins/builtin-plugin/react-attribute-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/richtext-edit-plugin.d.ts +76 -0
- package/es/plugins/builtin-plugin/richtext-edit-plugin.js +334 -0
- package/es/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -0
- package/es/render/contributions/render/arc-render.js +1 -4
- package/es/render/contributions/render/arc-render.js.map +1 -1
- package/es/render/contributions/render/area-render.js +1 -1
- package/es/render/contributions/render/area-render.js.map +1 -1
- package/es/render/contributions/render/base-3d-render.d.ts +10 -0
- package/es/render/contributions/render/base-3d-render.js +57 -0
- package/es/render/contributions/render/base-3d-render.js.map +1 -0
- package/es/render/contributions/render/base-render.js +3 -1
- package/es/render/contributions/render/base-render.js.map +1 -1
- package/es/render/contributions/render/draw-interceptor.js +7 -51
- package/es/render/contributions/render/draw-interceptor.js.map +1 -1
- package/es/render/contributions/render/group-render.js +3 -1
- package/es/render/contributions/render/group-render.js.map +1 -1
- package/es/render/contributions/render/pyramid3d-render.d.ts +3 -5
- package/es/render/contributions/render/pyramid3d-render.js +4 -56
- package/es/render/contributions/render/pyramid3d-render.js.map +1 -1
- package/es/render/contributions/render/rect3d-render.d.ts +3 -5
- package/es/render/contributions/render/rect3d-render.js +4 -55
- package/es/render/contributions/render/rect3d-render.js.map +1 -1
- package/es/render/contributions/render/symbol-render.js +9 -18
- package/es/render/contributions/render/symbol-render.js.map +1 -1
- package/es/render/contributions/render/utils.js +2 -5
- package/es/render/contributions/render/utils.js.map +1 -1
- package/package.json +4 -4
|
@@ -14,99 +14,9 @@ var __decorate = this && this.__decorate || function(decorators, target, key, de
|
|
|
14
14
|
|
|
15
15
|
Object.defineProperty(exports, "__esModule", {
|
|
16
16
|
value: !0
|
|
17
|
-
}), exports.DefaultGraphicService = exports.shouldUseMat4 = exports.getModelMatrix = exports.getExtraModelMatrix =
|
|
17
|
+
}), exports.DefaultGraphicService = exports.shouldUseMat4 = exports.getModelMatrix = exports.getExtraModelMatrix = void 0;
|
|
18
18
|
|
|
19
|
-
const inversify_lite_1 = require("../../common/inversify-lite"), vutils_1 = require("@visactor/vutils"), tapable_1 = require("../../tapable"), text_1 = require("../../common/text"), symbol_contribution_1 = require("./symbol-contribution"), tools_1 = require("../tools"), matrix_allocate_1 = require("../../allocator/matrix-allocate"), bounds_context_1 = require("../../common/bounds-context"), render_command_list_1 = require("../../common/render-command-list"), utils_1 = require("../../common/utils"), constants_1 = require("../constants"), common_contribution_1 = require("./common-contribution");
|
|
20
|
-
|
|
21
|
-
function identity(out) {
|
|
22
|
-
return out[0] = 1, out[1] = 0, out[2] = 0, out[3] = 0, out[4] = 0, out[5] = 1, out[6] = 0,
|
|
23
|
-
out[7] = 0, out[8] = 0, out[9] = 0, out[10] = 1, out[11] = 0, out[12] = 0, out[13] = 0,
|
|
24
|
-
out[14] = 0, out[15] = 1, out;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function rotateX(out, a, rad) {
|
|
28
|
-
const s = Math.sin(rad), c = Math.cos(rad), a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7], a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];
|
|
29
|
-
return a !== out && (out[0] = a[0], out[1] = a[1], out[2] = a[2], out[3] = a[3],
|
|
30
|
-
out[12] = a[12], out[13] = a[13], out[14] = a[14], out[15] = a[15]), out[4] = a10 * c + a20 * s,
|
|
31
|
-
out[5] = a11 * c + a21 * s, out[6] = a12 * c + a22 * s, out[7] = a13 * c + a23 * s,
|
|
32
|
-
out[8] = a20 * c - a10 * s, out[9] = a21 * c - a11 * s, out[10] = a22 * c - a12 * s,
|
|
33
|
-
out[11] = a23 * c - a13 * s, out;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function rotateY(out, a, rad) {
|
|
37
|
-
const s = Math.sin(rad), c = Math.cos(rad), a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3], a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];
|
|
38
|
-
return a !== out && (out[4] = a[4], out[5] = a[5], out[6] = a[6], out[7] = a[7],
|
|
39
|
-
out[12] = a[12], out[13] = a[13], out[14] = a[14], out[15] = a[15]), out[0] = a00 * c - a20 * s,
|
|
40
|
-
out[1] = a01 * c - a21 * s, out[2] = a02 * c - a22 * s, out[3] = a03 * c - a23 * s,
|
|
41
|
-
out[8] = a00 * s + a20 * c, out[9] = a01 * s + a21 * c, out[10] = a02 * s + a22 * c,
|
|
42
|
-
out[11] = a03 * s + a23 * c, out;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function rotateZ(out, a, rad) {
|
|
46
|
-
const s = Math.sin(rad), c = Math.cos(rad), a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3], a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];
|
|
47
|
-
return a !== out && (out[8] = a[8], out[9] = a[9], out[10] = a[10], out[11] = a[11],
|
|
48
|
-
out[12] = a[12], out[13] = a[13], out[14] = a[14], out[15] = a[15]), out[0] = a00 * c + a10 * s,
|
|
49
|
-
out[1] = a01 * c + a11 * s, out[2] = a02 * c + a12 * s, out[3] = a03 * c + a13 * s,
|
|
50
|
-
out[4] = a10 * c - a00 * s, out[5] = a11 * c - a01 * s, out[6] = a12 * c - a02 * s,
|
|
51
|
-
out[7] = a13 * c - a03 * s, out;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function translate(out, a, v) {
|
|
55
|
-
const x = v[0], y = v[1], z = v[2];
|
|
56
|
-
let a00, a01, a02, a03, a10, a11, a12, a13, a20, a21, a22, a23;
|
|
57
|
-
return a === out ? (out[12] = a[0] * x + a[4] * y + a[8] * z + a[12], out[13] = a[1] * x + a[5] * y + a[9] * z + a[13],
|
|
58
|
-
out[14] = a[2] * x + a[6] * y + a[10] * z + a[14], out[15] = a[3] * x + a[7] * y + a[11] * z + a[15]) : (a00 = a[0],
|
|
59
|
-
a01 = a[1], a02 = a[2], a03 = a[3], a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7],
|
|
60
|
-
a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11], out[0] = a00, out[1] = a01, out[2] = a02,
|
|
61
|
-
out[3] = a03, out[4] = a10, out[5] = a11, out[6] = a12, out[7] = a13, out[8] = a20,
|
|
62
|
-
out[9] = a21, out[10] = a22, out[11] = a23, out[12] = a00 * x + a10 * y + a20 * z + a[12],
|
|
63
|
-
out[13] = a01 * x + a11 * y + a21 * z + a[13], out[14] = a02 * x + a12 * y + a22 * z + a[14],
|
|
64
|
-
out[15] = a03 * x + a13 * y + a23 * z + a[15]), out;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function mat3Tomat4(out, b) {
|
|
68
|
-
out[0] = b.a, out[1] = b.b, out[2] = 0, out[3] = 0, out[4] = b.c, out[5] = b.d,
|
|
69
|
-
out[6] = 0, out[7] = 0, out[8] = 0, out[9] = 0, out[10] = 1, out[11] = 0, out[12] = b.e,
|
|
70
|
-
out[13] = b.f, out[14] = 0, out[15] = 1;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function multiplyMat4Mat3(out, a, b) {
|
|
74
|
-
const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3], a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7], a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11], a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];
|
|
75
|
-
let b0 = b.a, b1 = b.b, b2 = 0, b3 = 0;
|
|
76
|
-
return out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30, out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31,
|
|
77
|
-
out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32, out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33,
|
|
78
|
-
b0 = b.c, b1 = b.d, b2 = 0, b3 = 0, out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30,
|
|
79
|
-
out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31, out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32,
|
|
80
|
-
out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33, b0 = 0, b1 = 0, b2 = 1, b3 = 0,
|
|
81
|
-
out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30, out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31,
|
|
82
|
-
out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32, out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33,
|
|
83
|
-
b0 = b.e, b1 = b.f, b2 = 0, b3 = 1, out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30,
|
|
84
|
-
out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31, out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32,
|
|
85
|
-
out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33, out;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function scale(out, a, v) {
|
|
89
|
-
const x = v[0], y = v[1], z = v[2];
|
|
90
|
-
return out[0] = a[0] * x, out[1] = a[1] * x, out[2] = a[2] * x, out[3] = a[3] * x,
|
|
91
|
-
out[4] = a[4] * y, out[5] = a[5] * y, out[6] = a[6] * y, out[7] = a[7] * y, out[8] = a[8] * z,
|
|
92
|
-
out[9] = a[9] * z, out[10] = a[10] * z, out[11] = a[11] * z, out[12] = a[12], out[13] = a[13],
|
|
93
|
-
out[14] = a[14], out[15] = a[15], out;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
function multiplyMat4Mat4(out, a, b) {
|
|
97
|
-
const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3], a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7], a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11], a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];
|
|
98
|
-
let b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3];
|
|
99
|
-
return out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30, out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31,
|
|
100
|
-
out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32, out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33,
|
|
101
|
-
b0 = b[4], b1 = b[5], b2 = b[6], b3 = b[7], out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30,
|
|
102
|
-
out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31, out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32,
|
|
103
|
-
out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33, b0 = b[8], b1 = b[9], b2 = b[10],
|
|
104
|
-
b3 = b[11], out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30, out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31,
|
|
105
|
-
out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32, out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33,
|
|
106
|
-
b0 = b[12], b1 = b[13], b2 = b[14], b3 = b[15], out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30,
|
|
107
|
-
out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31, out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32,
|
|
108
|
-
out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33, out;
|
|
109
|
-
}
|
|
19
|
+
const inversify_lite_1 = require("../../common/inversify-lite"), vutils_1 = require("@visactor/vutils"), tapable_1 = require("../../tapable"), text_1 = require("../../common/text"), symbol_contribution_1 = require("./symbol-contribution"), tools_1 = require("../tools"), matrix_allocate_1 = require("../../allocator/matrix-allocate"), bounds_context_1 = require("../../common/bounds-context"), render_command_list_1 = require("../../common/render-command-list"), utils_1 = require("../../common/utils"), constants_1 = require("../constants"), common_contribution_1 = require("./common-contribution"), matrix_1 = require("../../common/matrix");
|
|
110
20
|
|
|
111
21
|
function getExtraModelMatrix(dx, dy, graphic) {
|
|
112
22
|
const {alpha: alpha, beta: beta} = graphic.attribute;
|
|
@@ -128,8 +38,9 @@ function getExtraModelMatrix(dx, dy, graphic) {
|
|
|
128
38
|
}
|
|
129
39
|
_anchor[0] += dx, _anchor[1] += dy;
|
|
130
40
|
const modelMatrix = matrix_allocate_1.mat4Allocate.allocate();
|
|
131
|
-
return translate(modelMatrix, modelMatrix, [ _anchor[0], _anchor[1], 0 ]),
|
|
132
|
-
|
|
41
|
+
return (0, matrix_1.translate)(modelMatrix, modelMatrix, [ _anchor[0], _anchor[1], 0 ]),
|
|
42
|
+
beta && (0, matrix_1.rotateX)(modelMatrix, modelMatrix, beta), alpha && (0, matrix_1.rotateY)(modelMatrix, modelMatrix, alpha),
|
|
43
|
+
(0, matrix_1.translate)(modelMatrix, modelMatrix, [ -_anchor[0], -_anchor[1], 0 ]),
|
|
133
44
|
modelMatrix;
|
|
134
45
|
}
|
|
135
46
|
|
|
@@ -147,9 +58,10 @@ function getModelMatrix(out, graphic, theme) {
|
|
|
147
58
|
} else _anchor[1] = anchor3d[1];
|
|
148
59
|
_anchor[2] = null !== (_a = anchor3d[2]) && void 0 !== _a ? _a : 0;
|
|
149
60
|
}
|
|
150
|
-
if (
|
|
151
|
-
|
|
152
|
-
|
|
61
|
+
if ((0, matrix_1.identityMat4)(out), (0, matrix_1.translate)(out, out, [ x + dx, y + dy, z + dz ]),
|
|
62
|
+
(0, matrix_1.translate)(out, out, [ _anchor[0], _anchor[1], _anchor[2] ]), (0, matrix_1.rotateX)(out, out, beta),
|
|
63
|
+
(0, matrix_1.rotateY)(out, out, alpha), (0, matrix_1.translate)(out, out, [ -_anchor[0], -_anchor[1], _anchor[2] ]),
|
|
64
|
+
(0, matrix_1.scaleMat4)(out, out, [ scaleX, scaleY, scaleZ ]), angle) {
|
|
153
65
|
const m = matrix_allocate_1.mat4Allocate.allocate(), _anchor = [ 0, 0 ];
|
|
154
66
|
if (anchor) {
|
|
155
67
|
if ("string" == typeof anchor3d[0]) {
|
|
@@ -161,8 +73,8 @@ function getModelMatrix(out, graphic, theme) {
|
|
|
161
73
|
_anchor[1] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;
|
|
162
74
|
} else _anchor[1] = anchor3d[1];
|
|
163
75
|
}
|
|
164
|
-
translate(m, m, [ _anchor[0], _anchor[1], 0 ]),
|
|
165
|
-
multiplyMat4Mat4(out, out, m);
|
|
76
|
+
(0, matrix_1.translate)(m, m, [ _anchor[0], _anchor[1], 0 ]), (0, matrix_1.rotateZ)(m, m, angle),
|
|
77
|
+
(0, matrix_1.translate)(m, m, [ -_anchor[0], -_anchor[1], 0 ]), (0, matrix_1.multiplyMat4Mat4)(out, out, m);
|
|
166
78
|
}
|
|
167
79
|
}
|
|
168
80
|
|
|
@@ -171,8 +83,6 @@ function shouldUseMat4(graphic) {
|
|
|
171
83
|
return alpha || beta;
|
|
172
84
|
}
|
|
173
85
|
|
|
174
|
-
exports.rotateX = rotateX, exports.rotateY = rotateY, exports.translate = translate,
|
|
175
|
-
exports.mat3Tomat4 = mat3Tomat4, exports.multiplyMat4Mat3 = multiplyMat4Mat3, exports.multiplyMat4Mat4 = multiplyMat4Mat4,
|
|
176
86
|
exports.getExtraModelMatrix = getExtraModelMatrix, exports.getModelMatrix = getModelMatrix,
|
|
177
87
|
exports.shouldUseMat4 = shouldUseMat4;
|
|
178
88
|
|
|
@@ -232,7 +142,7 @@ let DefaultGraphicService = class {
|
|
|
232
142
|
let {width: width, height: height} = attribute;
|
|
233
143
|
const {x1: x1, y1: y1, x: x, y: y} = attribute;
|
|
234
144
|
width = null != width ? width : x1 - x, height = null != height ? height : y1 - y,
|
|
235
|
-
aabbBounds.set(0, 0, width || 0, height || 0);
|
|
145
|
+
(isFinite(width) || isFinite(height) || isFinite(x) || isFinite(y)) && aabbBounds.set(0, 0, width || 0, height || 0);
|
|
236
146
|
}
|
|
237
147
|
const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
|
|
238
148
|
return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2),
|
|
@@ -243,7 +153,7 @@ let DefaultGraphicService = class {
|
|
|
243
153
|
updateGroupAABBBounds(attribute, groupTheme, aabbBounds, graphic) {
|
|
244
154
|
const originalAABBBounds = aabbBounds;
|
|
245
155
|
aabbBounds = aabbBounds.clone();
|
|
246
|
-
const {width: width, height: height, path: path, clip: clip = groupTheme.clip} = attribute;
|
|
156
|
+
const {width: width, height: height, path: path, clip: clip = groupTheme.clip, display: display} = attribute;
|
|
247
157
|
path && path.length ? path.forEach((g => {
|
|
248
158
|
aabbBounds.union(g.AABBBounds);
|
|
249
159
|
})) : null != width && null != height && aabbBounds.set(0, 0, Math.max(0, width), Math.max(0, height)),
|
|
@@ -398,16 +308,16 @@ let DefaultGraphicService = class {
|
|
|
398
308
|
aabbBounds;
|
|
399
309
|
}
|
|
400
310
|
updateLineAABBBoundsByPoints(attribute, lineTheme, aabbBounds, graphic) {
|
|
401
|
-
const {points: points = lineTheme.points} = attribute, b = aabbBounds;
|
|
311
|
+
const {points: points = lineTheme.points, connectedType: connectedType} = attribute, b = aabbBounds;
|
|
402
312
|
return points.forEach((p => {
|
|
403
|
-
b.add(p.x, p.y);
|
|
313
|
+
!1 === p.defined && "zero" !== connectedType || b.add(p.x, p.y);
|
|
404
314
|
})), b;
|
|
405
315
|
}
|
|
406
316
|
updateLineAABBBoundsBySegments(attribute, lineTheme, aabbBounds, graphic) {
|
|
407
|
-
const {segments: segments = lineTheme.segments} = attribute, b = aabbBounds;
|
|
317
|
+
const {segments: segments = lineTheme.segments, connectedType: connectedType} = attribute, b = aabbBounds;
|
|
408
318
|
return segments.forEach((s => {
|
|
409
319
|
s.points.forEach((p => {
|
|
410
|
-
b.add(p.x, p.y);
|
|
320
|
+
!1 === p.defined && "zero" !== connectedType || b.add(p.x, p.y);
|
|
411
321
|
}));
|
|
412
322
|
})), b;
|
|
413
323
|
}
|