@visactor/vrender-core 0.20.0-alpha.0 → 0.20.0-alpha.2
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/Ticker/default-ticker.d.ts +2 -53
- package/cjs/animate/Ticker/default-ticker.js +17 -130
- package/cjs/animate/Ticker/default-ticker.js.map +1 -1
- package/cjs/animate/Ticker/index.d.ts +4 -0
- package/cjs/animate/Ticker/index.js +3 -1
- package/cjs/animate/Ticker/index.js.map +1 -1
- package/cjs/animate/Ticker/manual-ticker-handler.d.ts +15 -0
- package/cjs/animate/Ticker/manual-ticker-handler.js +36 -0
- package/cjs/animate/Ticker/manual-ticker-handler.js.map +1 -0
- package/cjs/animate/Ticker/manual-ticker.d.ts +19 -0
- package/cjs/animate/Ticker/manual-ticker.js +37 -0
- package/cjs/animate/Ticker/manual-ticker.js.map +1 -0
- package/cjs/animate/Ticker/raf-tick-handler.d.ts +9 -0
- package/cjs/animate/Ticker/raf-tick-handler.js +30 -0
- package/cjs/animate/Ticker/raf-tick-handler.js.map +1 -0
- package/cjs/animate/Ticker/timeout-tick-handler.d.ts +9 -0
- package/cjs/animate/Ticker/timeout-tick-handler.js +28 -0
- package/cjs/animate/Ticker/timeout-tick-handler.js.map +1 -0
- package/cjs/animate/Ticker/type.d.ts +6 -0
- package/cjs/animate/Ticker/type.js +11 -0
- package/cjs/animate/Ticker/type.js.map +1 -0
- 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/conical-gradient.js.map +1 -1
- package/cjs/canvas/contributions/base-canvas.js +4 -13
- package/cjs/canvas/contributions/base-canvas.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 +50 -0
- package/cjs/common/3d-interceptor.js.map +1 -0
- package/cjs/common/bezier-utils.js +2 -1
- 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/render-command-list.js +1 -2
- package/cjs/common/render-curve.js +22 -32
- package/cjs/common/render-curve.js.map +1 -1
- package/cjs/common/render-utils.js +2 -1
- package/cjs/common/segment/catmull-rom-close.d.ts +41 -0
- package/cjs/common/segment/catmull-rom-close.js +81 -0
- package/cjs/common/segment/catmull-rom-close.js.map +1 -0
- package/cjs/common/segment/catmull-rom.d.ts +38 -0
- package/cjs/common/segment/catmull-rom.js +97 -0
- package/cjs/common/segment/catmull-rom.js.map +1 -0
- package/cjs/common/segment/index.d.ts +5 -2
- package/cjs/common/segment/index.js +8 -1
- package/cjs/common/segment/index.js.map +1 -1
- package/cjs/common/sort.js +15 -12
- package/cjs/common/sort.js.map +1 -1
- package/cjs/common/text.d.ts +0 -2
- package/cjs/common/text.js +8 -14
- 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/camera.js +3 -3
- package/cjs/core/camera.js.map +1 -1
- package/cjs/core/contributions/layerHandler/modules.js +2 -5
- package/cjs/core/contributions/layerHandler/modules.js.map +1 -1
- package/cjs/core/stage.d.ts +2 -2
- package/cjs/core/stage.js +23 -11
- package/cjs/core/stage.js.map +1 -1
- package/cjs/event/federated-event/base-event.js +12 -2
- package/cjs/event/federated-event/base-event.js.map +1 -1
- package/cjs/graphic/arc.d.ts +6 -4
- package/cjs/graphic/arc.js +46 -17
- package/cjs/graphic/arc.js.map +1 -1
- package/cjs/graphic/arc3d.d.ts +2 -2
- package/cjs/graphic/arc3d.js +8 -9
- package/cjs/graphic/arc3d.js.map +1 -1
- package/cjs/graphic/area.d.ts +5 -3
- package/cjs/graphic/area.js +27 -12
- package/cjs/graphic/area.js.map +1 -1
- package/cjs/graphic/builtin-symbol/index.d.ts +1 -1
- package/cjs/graphic/builtin-symbol/thin-triangle.d.ts +2 -2
- package/cjs/graphic/builtin-symbol/thin-triangle.js +2 -2
- package/cjs/graphic/builtin-symbol/thin-triangle.js.map +1 -1
- package/cjs/graphic/builtin-symbol/triangle-down.d.ts +1 -2
- package/cjs/graphic/builtin-symbol/triangle-down.js +4 -9
- package/cjs/graphic/builtin-symbol/triangle-down.js.map +1 -1
- package/cjs/graphic/builtin-symbol/triangle-left.d.ts +0 -1
- package/cjs/graphic/builtin-symbol/triangle-left.js +3 -8
- package/cjs/graphic/builtin-symbol/triangle-left.js.map +1 -1
- package/cjs/graphic/builtin-symbol/triangle-right.d.ts +1 -2
- package/cjs/graphic/builtin-symbol/triangle-right.js +4 -9
- package/cjs/graphic/builtin-symbol/triangle-right.js.map +1 -1
- package/cjs/graphic/builtin-symbol/triangle-up.d.ts +1 -2
- package/cjs/graphic/builtin-symbol/triangle-up.js +4 -9
- package/cjs/graphic/builtin-symbol/triangle-up.js.map +1 -1
- package/cjs/graphic/builtin-symbol/triangle.d.ts +1 -2
- package/cjs/graphic/builtin-symbol/triangle.js +1 -3
- package/cjs/graphic/builtin-symbol/triangle.js.map +1 -1
- package/cjs/graphic/builtin-symbol/utils.js +1 -5
- package/cjs/graphic/builtin-symbol/utils.js.map +1 -1
- package/cjs/graphic/circle.d.ts +5 -3
- package/cjs/graphic/circle.js +20 -12
- package/cjs/graphic/circle.js.map +1 -1
- package/cjs/graphic/config.js +7 -3
- package/cjs/graphic/config.js.map +1 -1
- package/cjs/graphic/glyph.d.ts +4 -2
- package/cjs/graphic/glyph.js +9 -2
- package/cjs/graphic/glyph.js.map +1 -1
- package/cjs/graphic/graphic-creator.js.map +1 -1
- package/cjs/graphic/graphic-service/common-outer-boder-bounds.d.ts +3 -0
- package/cjs/graphic/graphic-service/common-outer-boder-bounds.js +17 -0
- package/cjs/graphic/graphic-service/common-outer-boder-bounds.js.map +1 -0
- package/cjs/graphic/graphic-service/graphic-service.d.ts +7 -42
- package/cjs/graphic/graphic-service/graphic-service.js +21 -396
- package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
- package/cjs/graphic/graphic-service/symbol-outer-border-bounds.d.ts +3 -0
- package/cjs/graphic/graphic-service/symbol-outer-border-bounds.js +17 -0
- package/cjs/graphic/graphic-service/symbol-outer-border-bounds.js.map +1 -0
- package/cjs/graphic/graphic.d.ts +12 -9
- package/cjs/graphic/graphic.js +17 -2
- package/cjs/graphic/graphic.js.map +1 -1
- package/cjs/graphic/group.d.ts +7 -3
- package/cjs/graphic/group.js +34 -22
- package/cjs/graphic/group.js.map +1 -1
- package/cjs/graphic/image.d.ts +3 -2
- package/cjs/graphic/image.js +14 -9
- package/cjs/graphic/image.js.map +1 -1
- package/cjs/graphic/line.d.ts +5 -3
- package/cjs/graphic/line.js +24 -11
- package/cjs/graphic/line.js.map +1 -1
- package/cjs/graphic/node-tree.js.map +1 -1
- package/cjs/graphic/path.d.ts +3 -3
- package/cjs/graphic/path.js +17 -13
- package/cjs/graphic/path.js.map +1 -1
- package/cjs/graphic/polygon.d.ts +4 -3
- package/cjs/graphic/polygon.js +16 -11
- package/cjs/graphic/polygon.js.map +1 -1
- package/cjs/graphic/pyramid3d.d.ts +2 -2
- package/cjs/graphic/pyramid3d.js +10 -9
- package/cjs/graphic/pyramid3d.js.map +1 -1
- package/cjs/graphic/rect.d.ts +3 -3
- package/cjs/graphic/rect.js +16 -12
- package/cjs/graphic/rect.js.map +1 -1
- package/cjs/graphic/rect3d.js +2 -2
- package/cjs/graphic/rect3d.js.map +1 -1
- package/cjs/graphic/richtext/icon.d.ts +2 -2
- package/cjs/graphic/richtext/icon.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 +4 -4
- package/cjs/graphic/richtext.js +46 -14
- package/cjs/graphic/richtext.js.map +1 -1
- package/cjs/graphic/shadow-root.d.ts +2 -2
- package/cjs/graphic/shadow-root.js.map +1 -1
- package/cjs/graphic/symbol.d.ts +5 -3
- package/cjs/graphic/symbol.js +25 -12
- package/cjs/graphic/symbol.js.map +1 -1
- package/cjs/graphic/text.d.ts +10 -10
- package/cjs/graphic/text.js +27 -21
- package/cjs/graphic/text.js.map +1 -1
- package/cjs/graphic/theme.js.map +1 -1
- package/cjs/graphic/wrap-text.d.ts +1 -1
- package/cjs/graphic/wrap-text.js +2 -2
- package/cjs/graphic/wrap-text.js.map +1 -1
- package/cjs/index.d.ts +3 -0
- package/cjs/index.js +6 -4
- package/cjs/index.js.map +1 -1
- package/cjs/interface/graphic/arc.d.ts +2 -2
- package/cjs/interface/graphic/arc.js.map +1 -1
- package/cjs/interface/graphic/arc3d.d.ts +1 -1
- package/cjs/interface/graphic/arc3d.js.map +1 -1
- package/cjs/interface/graphic/area.d.ts +1 -0
- package/cjs/interface/graphic/area.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/line.d.ts +1 -0
- package/cjs/interface/graphic/line.js.map +1 -1
- package/cjs/interface/graphic/richText.d.ts +1 -0
- package/cjs/interface/graphic/richText.js.map +1 -1
- package/cjs/interface/graphic-service.d.ts +10 -17
- package/cjs/interface/graphic-service.js.map +1 -1
- package/cjs/interface/graphic.d.ts +2 -0
- package/cjs/interface/graphic.js.map +1 -1
- package/cjs/picker/pick-interceptor.d.ts +1 -1
- package/cjs/picker/pick-interceptor.js +6 -44
- 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/3dview-transform-plugin.d.ts +1 -0
- package/cjs/plugins/builtin-plugin/3dview-transform-plugin.js +8 -2
- package/cjs/plugins/builtin-plugin/3dview-transform-plugin.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/flex-layout-plugin.d.ts +1 -0
- package/cjs/plugins/builtin-plugin/flex-layout-plugin.js +8 -2
- package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +2 -2
- 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 +12 -28
- package/cjs/render/contributions/render/arc-render.js.map +1 -1
- package/cjs/render/contributions/render/area-render.js +12 -7
- 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.d.ts +1 -1
- 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/index.d.ts +1 -0
- package/cjs/render/contributions/render/index.js +3 -3
- package/cjs/render/contributions/render/index.js.map +1 -1
- package/cjs/render/contributions/render/line-render.js +6 -3
- package/cjs/render/contributions/render/line-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.d.ts +24 -0
- package/cjs/render/contributions/render/utils.js +51 -21
- package/cjs/render/contributions/render/utils.js.map +1 -1
- package/dist/index.es.js +9760 -9617
- 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/Ticker/default-ticker.d.ts +2 -53
- package/es/animate/Ticker/default-ticker.js +3 -106
- package/es/animate/Ticker/default-ticker.js.map +1 -1
- package/es/animate/Ticker/index.d.ts +4 -0
- package/es/animate/Ticker/index.js +8 -0
- package/es/animate/Ticker/index.js.map +1 -1
- package/es/animate/Ticker/manual-ticker-handler.d.ts +15 -0
- package/es/animate/Ticker/manual-ticker-handler.js +28 -0
- package/es/animate/Ticker/manual-ticker-handler.js.map +1 -0
- package/es/animate/Ticker/manual-ticker.d.ts +19 -0
- package/es/animate/Ticker/manual-ticker.js +31 -0
- package/es/animate/Ticker/manual-ticker.js.map +1 -0
- package/es/animate/Ticker/raf-tick-handler.d.ts +9 -0
- package/es/animate/Ticker/raf-tick-handler.js +22 -0
- package/es/animate/Ticker/raf-tick-handler.js.map +1 -0
- package/es/animate/Ticker/timeout-tick-handler.d.ts +9 -0
- package/es/animate/Ticker/timeout-tick-handler.js +20 -0
- package/es/animate/Ticker/timeout-tick-handler.js.map +1 -0
- package/es/animate/Ticker/type.d.ts +6 -0
- package/es/animate/Ticker/type.js +7 -0
- package/es/animate/Ticker/type.js.map +1 -0
- 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/conical-gradient.js.map +1 -1
- package/es/canvas/contributions/base-canvas.js +3 -15
- package/es/canvas/contributions/base-canvas.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 +46 -0
- package/es/common/3d-interceptor.js.map +1 -0
- package/es/common/bezier-utils.js +2 -1
- 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/render-command-list.js +1 -2
- package/es/common/render-curve.js +22 -32
- package/es/common/render-curve.js.map +1 -1
- package/es/common/render-utils.js +2 -1
- package/es/common/segment/catmull-rom-close.d.ts +41 -0
- package/es/common/segment/catmull-rom-close.js +74 -0
- package/es/common/segment/catmull-rom-close.js.map +1 -0
- package/es/common/segment/catmull-rom.d.ts +38 -0
- package/es/common/segment/catmull-rom.js +92 -0
- package/es/common/segment/catmull-rom.js.map +1 -0
- package/es/common/segment/index.d.ts +5 -2
- package/es/common/segment/index.js +11 -0
- package/es/common/segment/index.js.map +1 -1
- package/es/common/sort.js +15 -12
- package/es/common/sort.js.map +1 -1
- package/es/common/text.d.ts +0 -2
- package/es/common/text.js +6 -11
- 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/camera.js +5 -3
- package/es/core/camera.js.map +1 -1
- package/es/core/contributions/layerHandler/modules.js +2 -9
- package/es/core/contributions/layerHandler/modules.js.map +1 -1
- package/es/core/stage.d.ts +2 -2
- package/es/core/stage.js +22 -14
- package/es/core/stage.js.map +1 -1
- package/es/event/federated-event/base-event.js +12 -2
- package/es/event/federated-event/base-event.js.map +1 -1
- package/es/graphic/arc.d.ts +6 -4
- package/es/graphic/arc.js +47 -16
- package/es/graphic/arc.js.map +1 -1
- package/es/graphic/arc3d.d.ts +2 -2
- package/es/graphic/arc3d.js +7 -10
- package/es/graphic/arc3d.js.map +1 -1
- package/es/graphic/area.d.ts +5 -3
- package/es/graphic/area.js +28 -11
- package/es/graphic/area.js.map +1 -1
- package/es/graphic/builtin-symbol/index.d.ts +1 -1
- package/es/graphic/builtin-symbol/thin-triangle.d.ts +2 -2
- package/es/graphic/builtin-symbol/thin-triangle.js +2 -2
- package/es/graphic/builtin-symbol/thin-triangle.js.map +1 -1
- package/es/graphic/builtin-symbol/triangle-down.d.ts +1 -2
- package/es/graphic/builtin-symbol/triangle-down.js +2 -7
- package/es/graphic/builtin-symbol/triangle-down.js.map +1 -1
- package/es/graphic/builtin-symbol/triangle-left.d.ts +0 -1
- package/es/graphic/builtin-symbol/triangle-left.js +1 -6
- package/es/graphic/builtin-symbol/triangle-left.js.map +1 -1
- package/es/graphic/builtin-symbol/triangle-right.d.ts +1 -2
- package/es/graphic/builtin-symbol/triangle-right.js +2 -7
- package/es/graphic/builtin-symbol/triangle-right.js.map +1 -1
- package/es/graphic/builtin-symbol/triangle-up.d.ts +1 -2
- package/es/graphic/builtin-symbol/triangle-up.js +2 -7
- package/es/graphic/builtin-symbol/triangle-up.js.map +1 -1
- package/es/graphic/builtin-symbol/triangle.d.ts +1 -2
- package/es/graphic/builtin-symbol/triangle.js +1 -3
- package/es/graphic/builtin-symbol/triangle.js.map +1 -1
- package/es/graphic/builtin-symbol/utils.js +1 -4
- package/es/graphic/builtin-symbol/utils.js.map +1 -1
- package/es/graphic/circle.d.ts +5 -3
- package/es/graphic/circle.js +23 -9
- package/es/graphic/circle.js.map +1 -1
- package/es/graphic/config.js +7 -3
- package/es/graphic/config.js.map +1 -1
- package/es/graphic/glyph.d.ts +4 -2
- package/es/graphic/glyph.js +9 -1
- package/es/graphic/glyph.js.map +1 -1
- package/es/graphic/graphic-creator.js.map +1 -1
- package/es/graphic/graphic-service/common-outer-boder-bounds.d.ts +3 -0
- package/es/graphic/graphic-service/common-outer-boder-bounds.js +9 -0
- package/es/graphic/graphic-service/common-outer-boder-bounds.js.map +1 -0
- package/es/graphic/graphic-service/graphic-service.d.ts +7 -42
- package/es/graphic/graphic-service/graphic-service.js +14 -388
- package/es/graphic/graphic-service/graphic-service.js.map +1 -1
- package/es/graphic/graphic-service/symbol-outer-border-bounds.d.ts +3 -0
- package/es/graphic/graphic-service/symbol-outer-border-bounds.js +11 -0
- package/es/graphic/graphic-service/symbol-outer-border-bounds.js.map +1 -0
- package/es/graphic/graphic.d.ts +12 -9
- package/es/graphic/graphic.js +20 -3
- package/es/graphic/graphic.js.map +1 -1
- package/es/graphic/group.d.ts +7 -3
- package/es/graphic/group.js +32 -22
- package/es/graphic/group.js.map +1 -1
- package/es/graphic/image.d.ts +3 -2
- package/es/graphic/image.js +15 -8
- package/es/graphic/image.js.map +1 -1
- package/es/graphic/line.d.ts +5 -3
- package/es/graphic/line.js +25 -10
- package/es/graphic/line.js.map +1 -1
- package/es/graphic/node-tree.js.map +1 -1
- package/es/graphic/path.d.ts +3 -3
- package/es/graphic/path.js +18 -12
- package/es/graphic/path.js.map +1 -1
- package/es/graphic/polygon.d.ts +4 -3
- package/es/graphic/polygon.js +17 -10
- package/es/graphic/polygon.js.map +1 -1
- package/es/graphic/pyramid3d.d.ts +2 -2
- package/es/graphic/pyramid3d.js +8 -10
- package/es/graphic/pyramid3d.js.map +1 -1
- package/es/graphic/rect.d.ts +3 -3
- package/es/graphic/rect.js +16 -10
- package/es/graphic/rect.js.map +1 -1
- package/es/graphic/rect3d.js +1 -3
- package/es/graphic/rect3d.js.map +1 -1
- package/es/graphic/richtext/icon.d.ts +2 -2
- package/es/graphic/richtext/icon.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 +4 -4
- package/es/graphic/richtext.js +45 -13
- package/es/graphic/richtext.js.map +1 -1
- package/es/graphic/shadow-root.d.ts +2 -2
- package/es/graphic/shadow-root.js.map +1 -1
- package/es/graphic/symbol.d.ts +5 -3
- package/es/graphic/symbol.js +26 -11
- package/es/graphic/symbol.js.map +1 -1
- package/es/graphic/text.d.ts +10 -10
- package/es/graphic/text.js +28 -23
- package/es/graphic/text.js.map +1 -1
- package/es/graphic/theme.js.map +1 -1
- package/es/graphic/wrap-text.d.ts +1 -1
- package/es/graphic/wrap-text.js +1 -3
- package/es/graphic/wrap-text.js.map +1 -1
- package/es/index.d.ts +3 -0
- package/es/index.js +6 -0
- package/es/index.js.map +1 -1
- package/es/interface/graphic/arc.d.ts +2 -2
- package/es/interface/graphic/arc.js.map +1 -1
- package/es/interface/graphic/arc3d.d.ts +1 -1
- package/es/interface/graphic/arc3d.js.map +1 -1
- package/es/interface/graphic/area.d.ts +1 -0
- package/es/interface/graphic/area.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/line.d.ts +1 -0
- package/es/interface/graphic/line.js.map +1 -1
- package/es/interface/graphic/richText.d.ts +1 -0
- package/es/interface/graphic/richText.js.map +1 -1
- package/es/interface/graphic-service.d.ts +10 -17
- package/es/interface/graphic-service.js.map +1 -1
- package/es/interface/graphic.d.ts +2 -0
- package/es/interface/graphic.js.map +1 -1
- package/es/picker/pick-interceptor.d.ts +1 -1
- package/es/picker/pick-interceptor.js +10 -46
- 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/3dview-transform-plugin.d.ts +1 -0
- package/es/plugins/builtin-plugin/3dview-transform-plugin.js +6 -0
- package/es/plugins/builtin-plugin/3dview-transform-plugin.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/flex-layout-plugin.d.ts +1 -0
- package/es/plugins/builtin-plugin/flex-layout-plugin.js +6 -0
- package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/html-attribute-plugin.js +2 -2
- 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 +7 -16
- package/es/render/contributions/render/arc-render.js.map +1 -1
- package/es/render/contributions/render/area-render.js +12 -6
- 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.d.ts +1 -1
- 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/index.d.ts +1 -0
- package/es/render/contributions/render/index.js +2 -0
- package/es/render/contributions/render/index.js.map +1 -1
- package/es/render/contributions/render/line-render.js +6 -3
- package/es/render/contributions/render/line-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.d.ts +24 -0
- package/es/render/contributions/render/utils.js +41 -13
- package/es/render/contributions/render/utils.js.map +1 -1
- package/package.json +4 -4
- package/cjs/graphic/graphic-service/common-contribution.d.ts +0 -5
- package/cjs/graphic/graphic-service/common-contribution.js +0 -19
- package/cjs/graphic/graphic-service/common-contribution.js.map +0 -1
- package/cjs/graphic/graphic-service/symbol-contribution.d.ts +0 -6
- package/cjs/graphic/graphic-service/symbol-contribution.js +0 -21
- package/cjs/graphic/graphic-service/symbol-contribution.js.map +0 -1
- package/es/graphic/graphic-service/common-contribution.d.ts +0 -5
- package/es/graphic/graphic-service/common-contribution.js +0 -11
- package/es/graphic/graphic-service/common-contribution.js.map +0 -1
- package/es/graphic/graphic-service/symbol-contribution.d.ts +0 -6
- package/es/graphic/graphic-service/symbol-contribution.js +0 -15
- package/es/graphic/graphic-service/symbol-contribution.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/graphic/graphic-service/common-outer-boder-bounds.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAC7C,SAAqC,EACrC,KAAkC,EAClC,UAAuB,EACvB,EAAE;IACF,MAAM,EAAE,WAAW,EAAE,UAAU,GAAG,KAAK,CAAC,UAAU,EAAE,GAAG,SAAS,CAAC;IACjE,IAAI,WAAW,EAAE;QACf,MAAM,kBAAkB,GAAG,KAAK,CAAC,WAAW,CAAC;QAC7C,MAAM,EAAE,QAAQ,GAAG,kBAAkB,CAAC,QAAQ,EAAE,SAAS,GAAG,kBAAkB,CAAC,SAAS,EAAE,GAAG,WAAW,CAAC;QAGzG,UAAU,CAAC,MAAM,CAAE,QAAmB,GAAG,CAAC,UAAU,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;KACxE;IACD,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC","file":"common-outer-boder-bounds.js","sourcesContent":["import type { IAABBBounds } from '@visactor/vutils';\nimport type { IGraphicAttribute } from '../../interface';\n\nexport const updateBoundsOfCommonOuterBorder = (\n attribute: Partial<IGraphicAttribute>,\n theme: Required<IGraphicAttribute>,\n aabbBounds: IAABBBounds\n) => {\n const { outerBorder, shadowBlur = theme.shadowBlur } = attribute;\n if (outerBorder) {\n const defaultOuterBorder = theme.outerBorder;\n const { distance = defaultOuterBorder.distance, lineWidth = defaultOuterBorder.lineWidth } = outerBorder;\n\n // rect的distance一定是number\n aabbBounds.expand((distance as number) + (shadowBlur + lineWidth) / 2);\n }\n return aabbBounds;\n};\n"]}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import type { IAABBBounds
|
|
1
|
+
import type { IAABBBounds } from '@visactor/vutils';
|
|
2
2
|
import { AABBBounds } from '@visactor/vutils';
|
|
3
|
-
import type { mat4,
|
|
4
|
-
export declare function rotateX(out: mat4, a: mat4, rad: number): mat4;
|
|
5
|
-
export declare function rotateY(out: mat4, a: mat4, rad: number): mat4;
|
|
6
|
-
export declare function translate(out: mat4, a: mat4, v: vec3): mat4;
|
|
7
|
-
export declare function mat3Tomat4(out: mat4, b: IMatrix): void;
|
|
8
|
-
export declare function multiplyMat4Mat3(out: mat4, a: mat4, b: IMatrix): mat4;
|
|
9
|
-
export declare function multiplyMat4Mat4(out: mat4, a: mat4, b: mat4): mat4;
|
|
3
|
+
import type { mat4, IGraphicAttribute, IGraphic, IGroup, IStage, IText, ITextGraphicAttribute, ITransform, IGraphicService, IGraphicCreator, ISyncHook } from '../../interface';
|
|
10
4
|
export declare function getExtraModelMatrix(dx: number, dy: number, graphic: IGraphic): mat4 | null;
|
|
11
5
|
export declare function getModelMatrix(out: mat4, graphic: IGraphic, theme: ITransform): void;
|
|
12
6
|
export declare function shouldUseMat4(graphic: IGraphic): number;
|
|
@@ -24,12 +18,6 @@ export declare class DefaultGraphicService implements IGraphicService {
|
|
|
24
18
|
globalAABBBounds: IAABBBounds;
|
|
25
19
|
}, boolean]>;
|
|
26
20
|
};
|
|
27
|
-
protected _rectBoundsContribitions: IRectBoundsContribution[];
|
|
28
|
-
protected _symbolBoundsContribitions: ISymbolBoundsContribution[];
|
|
29
|
-
protected _imageBoundsContribitions: IImageBoundsContribution[];
|
|
30
|
-
protected _circleBoundsContribitions: ICircleBoundsContribution[];
|
|
31
|
-
protected _arcBoundsContribitions: IArcBoundsContribution[];
|
|
32
|
-
protected _pathBoundsContribitions: IPathBoundsContribution[];
|
|
33
21
|
protected tempAABBBounds1: AABBBounds;
|
|
34
22
|
protected tempAABBBounds2: AABBBounds;
|
|
35
23
|
constructor(creator: IGraphicCreator);
|
|
@@ -44,35 +32,12 @@ export declare class DefaultGraphicService implements IGraphicService {
|
|
|
44
32
|
globalAABBBounds: IAABBBounds;
|
|
45
33
|
}, selfChange: boolean): void;
|
|
46
34
|
updatePathProxyAABBBounds(aabbBounds: IAABBBounds, graphic?: IGraphic): boolean;
|
|
47
|
-
updateRectAABBBounds(attribute: IRectGraphicAttribute, rectTheme: Required<IRectGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IGraphic): IBounds;
|
|
48
|
-
updateGroupAABBBounds(attribute: IGroupGraphicAttribute, groupTheme: Required<IGroupGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IGroup): IBounds;
|
|
49
|
-
updateGlyphAABBBounds(attribute: IGlyphGraphicAttribute, theme: Required<IGlyphGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IGlyph): IBounds;
|
|
50
35
|
updateHTMLTextAABBBounds(attribute: ITextGraphicAttribute, textTheme: Required<ITextGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IText): void;
|
|
51
|
-
updateRichTextAABBBounds(attribute: IRichTextGraphicAttribute, richtextTheme: Required<IRichTextGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IRichText): IBounds;
|
|
52
|
-
updateTextAABBBounds(attribute: ITextGraphicAttribute, textTheme: Required<ITextGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IText): IBounds;
|
|
53
|
-
updatePathAABBBounds(attribute: IPathGraphicAttribute, pathTheme: Required<IPathGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IPath): IBounds;
|
|
54
|
-
protected updatePathAABBBoundsImprecise(attribute: IPathGraphicAttribute, pathTheme: Required<IPathGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IPath): IAABBBounds;
|
|
55
|
-
updatePyramid3dAABBBounds(attribute: IPyramid3dGraphicAttribute, polygonTheme: Required<IPyramid3dGraphicAttribute>, aabbBounds: IBounds, graphic?: IPyramid3d): IBounds;
|
|
56
|
-
updateArc3dAABBBounds(attribute: IArc3dGraphicAttribute, arcTheme: Required<IArc3dGraphicAttribute>, aabbBounds: IBounds, graphic?: IArc3d): IBounds;
|
|
57
|
-
updatePolygonAABBBounds(attribute: IPolygonGraphicAttribute, polygonTheme: Required<IPolygonGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IPolygon): IBounds;
|
|
58
|
-
protected updatePolygonAABBBoundsImprecise(attribute: IPolygonGraphicAttribute, polygonTheme: Required<IPolygonGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IPolygon): IAABBBounds;
|
|
59
|
-
updateLineAABBBounds(attribute: ILineGraphicAttribute, lineTheme: Required<ILineGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: ILine): IBounds;
|
|
60
|
-
protected updateLineAABBBoundsByPoints(attribute: ILineGraphicAttribute, lineTheme: Required<ILineGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: ILine): IAABBBounds;
|
|
61
|
-
protected updateLineAABBBoundsBySegments(attribute: ILineGraphicAttribute, lineTheme: Required<ILineGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: ILine): IAABBBounds;
|
|
62
|
-
updateAreaAABBBounds(attribute: IAreaGraphicAttribute, areaTheme: Required<IAreaGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IArea): IBounds;
|
|
63
|
-
protected updateAreaAABBBoundsByPoints(attribute: IAreaGraphicAttribute, areaTheme: Required<IAreaGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IArea): IAABBBounds;
|
|
64
|
-
protected updateAreaAABBBoundsBySegments(attribute: IAreaGraphicAttribute, areaTheme: Required<IAreaGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IArea): IAABBBounds;
|
|
65
|
-
updateCircleAABBBounds(attribute: ICircleGraphicAttribute, circleTheme: Required<ICircleGraphicAttribute>, aabbBounds: IAABBBounds, full?: boolean, graphic?: ICircle): IBounds;
|
|
66
|
-
protected updateCircleAABBBoundsImprecise(attribute: ICircleGraphicAttribute, circleTheme: Required<ICircleGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IGraphic): IAABBBounds;
|
|
67
|
-
protected updateCircleAABBBoundsAccurate(attribute: ICircleGraphicAttribute, circleTheme: Required<ICircleGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IGraphic): IAABBBounds;
|
|
68
|
-
updateArcAABBBounds(attribute: IArcGraphicAttribute, arcTheme: Required<IArcGraphicAttribute>, aabbBounds: IAABBBounds, full?: boolean, graphic?: IArc): IBounds;
|
|
69
|
-
protected updateArcAABBBoundsImprecise(attribute: IArcGraphicAttribute, arcTheme: Required<IArcGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IGraphic): IAABBBounds;
|
|
70
|
-
protected updateArcAABBBoundsAccurate(attribute: IArcGraphicAttribute, arcTheme: Required<IArcGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IGraphic): IAABBBounds;
|
|
71
|
-
updateSymbolAABBBounds(attribute: ISymbolGraphicAttribute, symbolTheme: Required<ISymbolGraphicAttribute>, aabbBounds: IAABBBounds, full?: boolean, graphic?: ISymbol): IBounds;
|
|
72
|
-
protected updateSymbolAABBBoundsImprecise(attribute: ISymbolGraphicAttribute, symbolTheme: Required<ISymbolGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IGraphic): IAABBBounds;
|
|
73
|
-
protected updateSymbolAABBBoundsAccurate(attribute: ISymbolGraphicAttribute, symbolTheme: Required<ISymbolGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: ISymbol): IAABBBounds;
|
|
74
|
-
updateImageAABBBounds(attribute: IImageGraphicAttribute, imageTheme: Required<IImageGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IGraphic): IBounds;
|
|
75
36
|
combindShadowAABBBounds(bounds: IAABBBounds, graphic?: IGraphic): void;
|
|
76
37
|
transformAABBBounds(attribute: Partial<IGraphicAttribute>, aabbBounds: IAABBBounds, theme: Required<IGraphicAttribute>, miter: boolean, graphic?: IGraphic): void;
|
|
77
|
-
|
|
38
|
+
validCheck(attribute: Partial<IGraphicAttribute>, theme: Required<IGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IGraphic): boolean;
|
|
39
|
+
updateTempAABBBounds(aabbBounds: IAABBBounds): {
|
|
40
|
+
tb1: AABBBounds;
|
|
41
|
+
tb2: AABBBounds;
|
|
42
|
+
};
|
|
78
43
|
}
|
|
@@ -12,14 +12,12 @@ var __decorate = this && this.__decorate || function(decorators, target, key, de
|
|
|
12
12
|
|
|
13
13
|
import { inject, injectable } from "../../common/inversify-lite";
|
|
14
14
|
|
|
15
|
-
import { AABBBounds,
|
|
15
|
+
import { AABBBounds, isNumber, transformBoundsWithMatrix } from "@visactor/vutils";
|
|
16
16
|
|
|
17
17
|
import { SyncHook } from "../../tapable";
|
|
18
18
|
|
|
19
19
|
import { textDrawOffsetX, textLayoutOffsetY } from "../../common/text";
|
|
20
20
|
|
|
21
|
-
import { DefaultSymbolOuterBorderBoundsContribution } from "./symbol-contribution";
|
|
22
|
-
|
|
23
21
|
import { boundStroke } from "../tools";
|
|
24
22
|
|
|
25
23
|
import { mat4Allocate } from "../../allocator/matrix-allocate";
|
|
@@ -28,101 +26,9 @@ import { BoundsContext } from "../../common/bounds-context";
|
|
|
28
26
|
|
|
29
27
|
import { renderCommandList } from "../../common/render-command-list";
|
|
30
28
|
|
|
31
|
-
import { circleBounds } from "../../common/utils";
|
|
32
|
-
|
|
33
29
|
import { GraphicCreator } from "../constants";
|
|
34
30
|
|
|
35
|
-
import {
|
|
36
|
-
|
|
37
|
-
function identity(out) {
|
|
38
|
-
return out[0] = 1, out[1] = 0, out[2] = 0, out[3] = 0, out[4] = 0, out[5] = 1, out[6] = 0,
|
|
39
|
-
out[7] = 0, out[8] = 0, out[9] = 0, out[10] = 1, out[11] = 0, out[12] = 0, out[13] = 0,
|
|
40
|
-
out[14] = 0, out[15] = 1, out;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export function rotateX(out, a, rad) {
|
|
44
|
-
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];
|
|
45
|
-
return a !== out && (out[0] = a[0], out[1] = a[1], out[2] = a[2], out[3] = a[3],
|
|
46
|
-
out[12] = a[12], out[13] = a[13], out[14] = a[14], out[15] = a[15]), out[4] = a10 * c + a20 * s,
|
|
47
|
-
out[5] = a11 * c + a21 * s, out[6] = a12 * c + a22 * s, out[7] = a13 * c + a23 * s,
|
|
48
|
-
out[8] = a20 * c - a10 * s, out[9] = a21 * c - a11 * s, out[10] = a22 * c - a12 * s,
|
|
49
|
-
out[11] = a23 * c - a13 * s, out;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export function rotateY(out, a, rad) {
|
|
53
|
-
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];
|
|
54
|
-
return a !== out && (out[4] = a[4], out[5] = a[5], out[6] = a[6], out[7] = a[7],
|
|
55
|
-
out[12] = a[12], out[13] = a[13], out[14] = a[14], out[15] = a[15]), out[0] = a00 * c - a20 * s,
|
|
56
|
-
out[1] = a01 * c - a21 * s, out[2] = a02 * c - a22 * s, out[3] = a03 * c - a23 * s,
|
|
57
|
-
out[8] = a00 * s + a20 * c, out[9] = a01 * s + a21 * c, out[10] = a02 * s + a22 * c,
|
|
58
|
-
out[11] = a03 * s + a23 * c, out;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function rotateZ(out, a, rad) {
|
|
62
|
-
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];
|
|
63
|
-
return a !== out && (out[8] = a[8], out[9] = a[9], out[10] = a[10], out[11] = a[11],
|
|
64
|
-
out[12] = a[12], out[13] = a[13], out[14] = a[14], out[15] = a[15]), out[0] = a00 * c + a10 * s,
|
|
65
|
-
out[1] = a01 * c + a11 * s, out[2] = a02 * c + a12 * s, out[3] = a03 * c + a13 * s,
|
|
66
|
-
out[4] = a10 * c - a00 * s, out[5] = a11 * c - a01 * s, out[6] = a12 * c - a02 * s,
|
|
67
|
-
out[7] = a13 * c - a03 * s, out;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export function translate(out, a, v) {
|
|
71
|
-
const x = v[0], y = v[1], z = v[2];
|
|
72
|
-
let a00, a01, a02, a03, a10, a11, a12, a13, a20, a21, a22, a23;
|
|
73
|
-
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],
|
|
74
|
-
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],
|
|
75
|
-
a01 = a[1], a02 = a[2], a03 = a[3], a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7],
|
|
76
|
-
a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11], out[0] = a00, out[1] = a01, out[2] = a02,
|
|
77
|
-
out[3] = a03, out[4] = a10, out[5] = a11, out[6] = a12, out[7] = a13, out[8] = a20,
|
|
78
|
-
out[9] = a21, out[10] = a22, out[11] = a23, out[12] = a00 * x + a10 * y + a20 * z + a[12],
|
|
79
|
-
out[13] = a01 * x + a11 * y + a21 * z + a[13], out[14] = a02 * x + a12 * y + a22 * z + a[14],
|
|
80
|
-
out[15] = a03 * x + a13 * y + a23 * z + a[15]), out;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export function mat3Tomat4(out, b) {
|
|
84
|
-
out[0] = b.a, out[1] = b.b, out[2] = 0, out[3] = 0, out[4] = b.c, out[5] = b.d,
|
|
85
|
-
out[6] = 0, out[7] = 0, out[8] = 0, out[9] = 0, out[10] = 1, out[11] = 0, out[12] = b.e,
|
|
86
|
-
out[13] = b.f, out[14] = 0, out[15] = 1;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export function multiplyMat4Mat3(out, a, b) {
|
|
90
|
-
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];
|
|
91
|
-
let b0 = b.a, b1 = b.b, b2 = 0, b3 = 0;
|
|
92
|
-
return out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30, out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31,
|
|
93
|
-
out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32, out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33,
|
|
94
|
-
b0 = b.c, b1 = b.d, b2 = 0, b3 = 0, out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30,
|
|
95
|
-
out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31, out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32,
|
|
96
|
-
out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33, b0 = 0, b1 = 0, b2 = 1, b3 = 0,
|
|
97
|
-
out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30, out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31,
|
|
98
|
-
out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32, out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33,
|
|
99
|
-
b0 = b.e, b1 = b.f, b2 = 0, b3 = 1, out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30,
|
|
100
|
-
out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31, out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32,
|
|
101
|
-
out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33, out;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function scale(out, a, v) {
|
|
105
|
-
const x = v[0], y = v[1], z = v[2];
|
|
106
|
-
return out[0] = a[0] * x, out[1] = a[1] * x, out[2] = a[2] * x, out[3] = a[3] * x,
|
|
107
|
-
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,
|
|
108
|
-
out[9] = a[9] * z, out[10] = a[10] * z, out[11] = a[11] * z, out[12] = a[12], out[13] = a[13],
|
|
109
|
-
out[14] = a[14], out[15] = a[15], out;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export function multiplyMat4Mat4(out, a, b) {
|
|
113
|
-
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];
|
|
114
|
-
let b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3];
|
|
115
|
-
return out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30, out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31,
|
|
116
|
-
out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32, out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33,
|
|
117
|
-
b0 = b[4], b1 = b[5], b2 = b[6], b3 = b[7], out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30,
|
|
118
|
-
out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31, out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32,
|
|
119
|
-
out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33, b0 = b[8], b1 = b[9], b2 = b[10],
|
|
120
|
-
b3 = b[11], out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30, out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31,
|
|
121
|
-
out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32, out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33,
|
|
122
|
-
b0 = b[12], b1 = b[13], b2 = b[14], b3 = b[15], out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30,
|
|
123
|
-
out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31, out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32,
|
|
124
|
-
out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33, out;
|
|
125
|
-
}
|
|
31
|
+
import { identityMat4, multiplyMat4Mat4, rotateX, rotateY, rotateZ, scaleMat4, translate } from "../../common/matrix";
|
|
126
32
|
|
|
127
33
|
export function getExtraModelMatrix(dx, dy, graphic) {
|
|
128
34
|
const {alpha: alpha, beta: beta} = graphic.attribute;
|
|
@@ -163,9 +69,9 @@ export function getModelMatrix(out, graphic, theme) {
|
|
|
163
69
|
} else _anchor[1] = anchor3d[1];
|
|
164
70
|
_anchor[2] = null !== (_a = anchor3d[2]) && void 0 !== _a ? _a : 0;
|
|
165
71
|
}
|
|
166
|
-
if (
|
|
72
|
+
if (identityMat4(out), translate(out, out, [ x + dx, y + dy, z + dz ]), translate(out, out, [ _anchor[0], _anchor[1], _anchor[2] ]),
|
|
167
73
|
rotateX(out, out, beta), rotateY(out, out, alpha), translate(out, out, [ -_anchor[0], -_anchor[1], _anchor[2] ]),
|
|
168
|
-
|
|
74
|
+
scaleMat4(out, out, [ scaleX, scaleY, scaleZ ]), angle) {
|
|
169
75
|
const m = mat4Allocate.allocate(), _anchor = [ 0, 0 ];
|
|
170
76
|
if (anchor) {
|
|
171
77
|
if ("string" == typeof anchor3d[0]) {
|
|
@@ -198,10 +104,7 @@ let DefaultGraphicService = class {
|
|
|
198
104
|
onClearIncremental: new SyncHook([ "graphic", "group", "stage" ]),
|
|
199
105
|
beforeUpdateAABBBounds: new SyncHook([ "graphic", "stage", "willUpdate", "aabbBounds" ]),
|
|
200
106
|
afterUpdateAABBBounds: new SyncHook([ "graphic", "stage", "aabbBounds", "globalAABBBounds", "selfChange" ])
|
|
201
|
-
}, this.tempAABBBounds1 = new AABBBounds, this.tempAABBBounds2 = new AABBBounds
|
|
202
|
-
this._rectBoundsContribitions = [ new DefaultOuterBorderBoundsContribution ], this._symbolBoundsContribitions = [ new DefaultSymbolOuterBorderBoundsContribution ],
|
|
203
|
-
this._imageBoundsContribitions = [ new DefaultOuterBorderBoundsContribution ], this._circleBoundsContribitions = [ new DefaultOuterBorderBoundsContribution ],
|
|
204
|
-
this._arcBoundsContribitions = [ new DefaultOuterBorderBoundsContribution ], this._pathBoundsContribitions = [ new DefaultOuterBorderBoundsContribution ];
|
|
107
|
+
}, this.tempAABBBounds1 = new AABBBounds, this.tempAABBBounds2 = new AABBBounds;
|
|
205
108
|
}
|
|
206
109
|
onAttributeUpdate(graphic) {
|
|
207
110
|
this.hooks.onAttributeUpdate.taps.length && this.hooks.onAttributeUpdate.call(graphic);
|
|
@@ -233,40 +136,6 @@ let DefaultGraphicService = class {
|
|
|
233
136
|
const boundsContext = new BoundsContext(aabbBounds);
|
|
234
137
|
return renderCommandList(path.commandList, boundsContext, 0, 0), !0;
|
|
235
138
|
}
|
|
236
|
-
updateRectAABBBounds(attribute, rectTheme, aabbBounds, graphic) {
|
|
237
|
-
if (!this._validCheck(attribute, rectTheme, aabbBounds, graphic)) return aabbBounds;
|
|
238
|
-
if (!this.updatePathProxyAABBBounds(aabbBounds, graphic)) {
|
|
239
|
-
let {width: width, height: height} = attribute;
|
|
240
|
-
const {x1: x1, y1: y1, x: x, y: y} = attribute;
|
|
241
|
-
width = null != width ? width : x1 - x, height = null != height ? height : y1 - y,
|
|
242
|
-
aabbBounds.set(0, 0, width || 0, height || 0);
|
|
243
|
-
}
|
|
244
|
-
const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
|
|
245
|
-
return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2),
|
|
246
|
-
tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this._rectBoundsContribitions.length && this._rectBoundsContribitions.forEach((c => {
|
|
247
|
-
c.updateBounds(attribute, rectTheme, tb1, graphic), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
|
|
248
|
-
})), this.transformAABBBounds(attribute, aabbBounds, rectTheme, !1, graphic), aabbBounds;
|
|
249
|
-
}
|
|
250
|
-
updateGroupAABBBounds(attribute, groupTheme, aabbBounds, graphic) {
|
|
251
|
-
const originalAABBBounds = aabbBounds;
|
|
252
|
-
aabbBounds = aabbBounds.clone();
|
|
253
|
-
const {width: width, height: height, path: path, clip: clip = groupTheme.clip} = attribute;
|
|
254
|
-
path && path.length ? path.forEach((g => {
|
|
255
|
-
aabbBounds.union(g.AABBBounds);
|
|
256
|
-
})) : null != width && null != height && aabbBounds.set(0, 0, Math.max(0, width), Math.max(0, height)),
|
|
257
|
-
clip || graphic.forEachChildren((node => {
|
|
258
|
-
aabbBounds.union(node.AABBBounds);
|
|
259
|
-
}));
|
|
260
|
-
const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
|
|
261
|
-
return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2),
|
|
262
|
-
tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this.transformAABBBounds(attribute, aabbBounds, groupTheme, !1, graphic),
|
|
263
|
-
originalAABBBounds.copy(aabbBounds), originalAABBBounds;
|
|
264
|
-
}
|
|
265
|
-
updateGlyphAABBBounds(attribute, theme, aabbBounds, graphic) {
|
|
266
|
-
return this._validCheck(attribute, theme, aabbBounds, graphic) ? (graphic.getSubGraphic().forEach((node => {
|
|
267
|
-
aabbBounds.union(node.AABBBounds);
|
|
268
|
-
})), aabbBounds) : aabbBounds;
|
|
269
|
-
}
|
|
270
139
|
updateHTMLTextAABBBounds(attribute, textTheme, aabbBounds, graphic) {
|
|
271
140
|
const {textAlign: textAlign, textBaseline: textBaseline} = attribute;
|
|
272
141
|
if (null != attribute.forceBoundsHeight) {
|
|
@@ -278,257 +147,6 @@ let DefaultGraphicService = class {
|
|
|
278
147
|
aabbBounds.set(dx, aabbBounds.y1, dx + w, aabbBounds.y2);
|
|
279
148
|
}
|
|
280
149
|
}
|
|
281
|
-
updateRichTextAABBBounds(attribute, richtextTheme, aabbBounds, graphic) {
|
|
282
|
-
if (!this._validCheck(attribute, richtextTheme, aabbBounds, graphic)) return aabbBounds;
|
|
283
|
-
if (!graphic) return aabbBounds;
|
|
284
|
-
const {width: width = richtextTheme.width, height: height = richtextTheme.height, maxWidth: maxWidth = richtextTheme.maxWidth, maxHeight: maxHeight = richtextTheme.maxHeight, textAlign: textAlign = richtextTheme.textAlign, textBaseline: textBaseline = richtextTheme.textBaseline} = attribute;
|
|
285
|
-
if (width > 0 && height > 0) aabbBounds.set(0, 0, width, height); else {
|
|
286
|
-
const frameCache = graphic.getFrameCache(), {width: actualWidth, height: actualHeight} = frameCache.getActualSize();
|
|
287
|
-
let contentWidth = width || actualWidth || 0, contentHeight = height || actualHeight || 0;
|
|
288
|
-
contentHeight = "number" == typeof maxHeight && contentHeight > maxHeight ? maxHeight : contentHeight || 0,
|
|
289
|
-
contentWidth = "number" == typeof maxWidth && contentWidth > maxWidth ? maxWidth : contentWidth || 0,
|
|
290
|
-
aabbBounds.set(0, 0, contentWidth, contentHeight);
|
|
291
|
-
}
|
|
292
|
-
let deltaY = 0;
|
|
293
|
-
switch (textBaseline) {
|
|
294
|
-
case "top":
|
|
295
|
-
deltaY = 0;
|
|
296
|
-
break;
|
|
297
|
-
|
|
298
|
-
case "middle":
|
|
299
|
-
deltaY = -aabbBounds.height() / 2;
|
|
300
|
-
break;
|
|
301
|
-
|
|
302
|
-
case "bottom":
|
|
303
|
-
deltaY = -aabbBounds.height();
|
|
304
|
-
}
|
|
305
|
-
let deltaX = 0;
|
|
306
|
-
switch (textAlign) {
|
|
307
|
-
case "left":
|
|
308
|
-
deltaX = 0;
|
|
309
|
-
break;
|
|
310
|
-
|
|
311
|
-
case "center":
|
|
312
|
-
deltaX = -aabbBounds.width() / 2;
|
|
313
|
-
break;
|
|
314
|
-
|
|
315
|
-
case "right":
|
|
316
|
-
deltaX = -aabbBounds.width();
|
|
317
|
-
}
|
|
318
|
-
aabbBounds.translate(deltaX, deltaY);
|
|
319
|
-
const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
|
|
320
|
-
return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2),
|
|
321
|
-
tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), null == attribute.forceBoundsHeight && null == attribute.forceBoundsWidth || this.updateHTMLTextAABBBounds(attribute, richtextTheme, aabbBounds),
|
|
322
|
-
this.transformAABBBounds(attribute, aabbBounds, richtextTheme, !1, graphic), aabbBounds;
|
|
323
|
-
}
|
|
324
|
-
updateTextAABBBounds(attribute, textTheme, aabbBounds, graphic) {
|
|
325
|
-
if (!this._validCheck(attribute, textTheme, aabbBounds, graphic)) return aabbBounds;
|
|
326
|
-
if (!graphic) return aabbBounds;
|
|
327
|
-
const {text: text = textTheme.text} = graphic.attribute;
|
|
328
|
-
Array.isArray(text) ? graphic.updateMultilineAABBBounds(text) : graphic.updateSingallineAABBBounds(text);
|
|
329
|
-
const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
|
|
330
|
-
tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2);
|
|
331
|
-
const {scaleX: scaleX = textTheme.scaleX, scaleY: scaleY = textTheme.scaleY, shadowBlur: shadowBlur = textTheme.shadowBlur, strokeBoundsBuffer: strokeBoundsBuffer = textTheme.strokeBoundsBuffer} = attribute;
|
|
332
|
-
if (shadowBlur) {
|
|
333
|
-
const shadowBlurHalfWidth = shadowBlur / Math.abs(scaleX + scaleY);
|
|
334
|
-
boundStroke(tb1, shadowBlurHalfWidth, !0, strokeBoundsBuffer), aabbBounds.union(tb1);
|
|
335
|
-
}
|
|
336
|
-
return this.combindShadowAABBBounds(aabbBounds, graphic), null == attribute.forceBoundsHeight && null == attribute.forceBoundsWidth || this.updateHTMLTextAABBBounds(attribute, textTheme, aabbBounds),
|
|
337
|
-
transformBoundsWithMatrix(aabbBounds, aabbBounds, graphic.transMatrix), aabbBounds;
|
|
338
|
-
}
|
|
339
|
-
updatePathAABBBounds(attribute, pathTheme, aabbBounds, graphic) {
|
|
340
|
-
if (!this._validCheck(attribute, pathTheme, aabbBounds, graphic)) return aabbBounds;
|
|
341
|
-
this.updatePathProxyAABBBounds(aabbBounds, graphic) || this.updatePathAABBBoundsImprecise(attribute, pathTheme, aabbBounds, graphic);
|
|
342
|
-
const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
|
|
343
|
-
tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2),
|
|
344
|
-
this._pathBoundsContribitions.length && this._pathBoundsContribitions.forEach((c => {
|
|
345
|
-
c.updateBounds(attribute, pathTheme, tb1, graphic), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
|
|
346
|
-
}));
|
|
347
|
-
const {lineJoin: lineJoin = pathTheme.lineJoin} = attribute;
|
|
348
|
-
return this.transformAABBBounds(attribute, aabbBounds, pathTheme, "miter" === lineJoin, graphic),
|
|
349
|
-
aabbBounds;
|
|
350
|
-
}
|
|
351
|
-
updatePathAABBBoundsImprecise(attribute, pathTheme, aabbBounds, graphic) {
|
|
352
|
-
if (!graphic) return aabbBounds;
|
|
353
|
-
const pathShape = graphic.getParsedPathShape();
|
|
354
|
-
return aabbBounds.union(pathShape.getBounds()), aabbBounds;
|
|
355
|
-
}
|
|
356
|
-
updatePyramid3dAABBBounds(attribute, polygonTheme, aabbBounds, graphic) {
|
|
357
|
-
if (!graphic) return aabbBounds;
|
|
358
|
-
const stage = graphic.stage;
|
|
359
|
-
if (!stage || !stage.camera) return aabbBounds;
|
|
360
|
-
graphic.findFace().vertices.forEach((v => {
|
|
361
|
-
const x = v[0], y = v[1];
|
|
362
|
-
aabbBounds.add(x, y);
|
|
363
|
-
}));
|
|
364
|
-
const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
|
|
365
|
-
return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2),
|
|
366
|
-
tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this.transformAABBBounds(attribute, aabbBounds, polygonTheme, !1, graphic),
|
|
367
|
-
aabbBounds;
|
|
368
|
-
}
|
|
369
|
-
updateArc3dAABBBounds(attribute, arcTheme, aabbBounds, graphic) {
|
|
370
|
-
if (!graphic) return aabbBounds;
|
|
371
|
-
const stage = graphic.stage;
|
|
372
|
-
if (!stage || !stage.camera) return aabbBounds;
|
|
373
|
-
const {outerRadius: outerRadius = arcTheme.outerRadius, height: height = 0} = attribute, r = outerRadius + height;
|
|
374
|
-
aabbBounds.setValue(-r, -r, r, r);
|
|
375
|
-
const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
|
|
376
|
-
return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2),
|
|
377
|
-
tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this.transformAABBBounds(attribute, aabbBounds, arcTheme, !1, graphic),
|
|
378
|
-
aabbBounds;
|
|
379
|
-
}
|
|
380
|
-
updatePolygonAABBBounds(attribute, polygonTheme, aabbBounds, graphic) {
|
|
381
|
-
if (!this._validCheck(attribute, polygonTheme, aabbBounds, graphic)) return aabbBounds;
|
|
382
|
-
this.updatePathProxyAABBBounds(aabbBounds, graphic) || this.updatePolygonAABBBoundsImprecise(attribute, polygonTheme, aabbBounds, graphic);
|
|
383
|
-
const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
|
|
384
|
-
tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2);
|
|
385
|
-
const {lineJoin: lineJoin = polygonTheme.lineJoin} = attribute;
|
|
386
|
-
return this.transformAABBBounds(attribute, aabbBounds, polygonTheme, "miter" === lineJoin, graphic),
|
|
387
|
-
aabbBounds;
|
|
388
|
-
}
|
|
389
|
-
updatePolygonAABBBoundsImprecise(attribute, polygonTheme, aabbBounds, graphic) {
|
|
390
|
-
const {points: points = polygonTheme.points} = attribute;
|
|
391
|
-
return points.forEach((p => {
|
|
392
|
-
aabbBounds.add(p.x, p.y);
|
|
393
|
-
})), aabbBounds;
|
|
394
|
-
}
|
|
395
|
-
updateLineAABBBounds(attribute, lineTheme, aabbBounds, graphic) {
|
|
396
|
-
if (!this._validCheck(attribute, lineTheme, aabbBounds, graphic)) return aabbBounds;
|
|
397
|
-
this.updatePathProxyAABBBounds(aabbBounds, graphic) || (attribute.segments ? this.updateLineAABBBoundsBySegments(attribute, lineTheme, aabbBounds, graphic) : this.updateLineAABBBoundsByPoints(attribute, lineTheme, aabbBounds, graphic));
|
|
398
|
-
const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
|
|
399
|
-
tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2);
|
|
400
|
-
const {lineJoin: lineJoin = lineTheme.lineJoin} = attribute;
|
|
401
|
-
return this.transformAABBBounds(attribute, aabbBounds, lineTheme, "miter" === lineJoin, graphic),
|
|
402
|
-
aabbBounds;
|
|
403
|
-
}
|
|
404
|
-
updateLineAABBBoundsByPoints(attribute, lineTheme, aabbBounds, graphic) {
|
|
405
|
-
const {points: points = lineTheme.points} = attribute, b = aabbBounds;
|
|
406
|
-
return points.forEach((p => {
|
|
407
|
-
b.add(p.x, p.y);
|
|
408
|
-
})), b;
|
|
409
|
-
}
|
|
410
|
-
updateLineAABBBoundsBySegments(attribute, lineTheme, aabbBounds, graphic) {
|
|
411
|
-
const {segments: segments = lineTheme.segments} = attribute, b = aabbBounds;
|
|
412
|
-
return segments.forEach((s => {
|
|
413
|
-
s.points.forEach((p => {
|
|
414
|
-
b.add(p.x, p.y);
|
|
415
|
-
}));
|
|
416
|
-
})), b;
|
|
417
|
-
}
|
|
418
|
-
updateAreaAABBBounds(attribute, areaTheme, aabbBounds, graphic) {
|
|
419
|
-
if (!this._validCheck(attribute, areaTheme, aabbBounds, graphic)) return aabbBounds;
|
|
420
|
-
this.updatePathProxyAABBBounds(aabbBounds, graphic) || (attribute.segments ? this.updateAreaAABBBoundsBySegments(attribute, areaTheme, aabbBounds, graphic) : this.updateAreaAABBBoundsByPoints(attribute, areaTheme, aabbBounds, graphic));
|
|
421
|
-
const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
|
|
422
|
-
tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2);
|
|
423
|
-
const {lineJoin: lineJoin = areaTheme.lineJoin} = attribute;
|
|
424
|
-
return this.transformAABBBounds(attribute, aabbBounds, areaTheme, "miter" === lineJoin, graphic),
|
|
425
|
-
aabbBounds;
|
|
426
|
-
}
|
|
427
|
-
updateAreaAABBBoundsByPoints(attribute, areaTheme, aabbBounds, graphic) {
|
|
428
|
-
const {points: points = areaTheme.points} = attribute, b = aabbBounds;
|
|
429
|
-
return points.forEach((p => {
|
|
430
|
-
var _a, _b;
|
|
431
|
-
b.add(p.x, p.y), b.add(null !== (_a = p.x1) && void 0 !== _a ? _a : p.x, null !== (_b = p.y1) && void 0 !== _b ? _b : p.y);
|
|
432
|
-
})), b;
|
|
433
|
-
}
|
|
434
|
-
updateAreaAABBBoundsBySegments(attribute, areaTheme, aabbBounds, graphic) {
|
|
435
|
-
const {segments: segments = areaTheme.segments} = attribute, b = aabbBounds;
|
|
436
|
-
return segments.forEach((s => {
|
|
437
|
-
s.points.forEach((p => {
|
|
438
|
-
var _a, _b;
|
|
439
|
-
b.add(p.x, p.y), b.add(null !== (_a = p.x1) && void 0 !== _a ? _a : p.x, null !== (_b = p.y1) && void 0 !== _b ? _b : p.y);
|
|
440
|
-
}));
|
|
441
|
-
})), b;
|
|
442
|
-
}
|
|
443
|
-
updateCircleAABBBounds(attribute, circleTheme, aabbBounds, full, graphic) {
|
|
444
|
-
if (!this._validCheck(attribute, circleTheme, aabbBounds, graphic)) return aabbBounds;
|
|
445
|
-
this.updatePathProxyAABBBounds(aabbBounds, graphic) || (full ? this.updateCircleAABBBoundsImprecise(attribute, circleTheme, aabbBounds, graphic) : this.updateCircleAABBBoundsAccurate(attribute, circleTheme, aabbBounds, graphic));
|
|
446
|
-
const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
|
|
447
|
-
return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2),
|
|
448
|
-
tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this._circleBoundsContribitions.length && this._circleBoundsContribitions.forEach((c => {
|
|
449
|
-
c.updateBounds(attribute, circleTheme, tb1, graphic), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
|
|
450
|
-
})), this.transformAABBBounds(attribute, aabbBounds, circleTheme, !1, graphic),
|
|
451
|
-
aabbBounds;
|
|
452
|
-
}
|
|
453
|
-
updateCircleAABBBoundsImprecise(attribute, circleTheme, aabbBounds, graphic) {
|
|
454
|
-
const {radius: radius = circleTheme.radius} = attribute;
|
|
455
|
-
return aabbBounds.set(-radius, -radius, radius, radius), aabbBounds;
|
|
456
|
-
}
|
|
457
|
-
updateCircleAABBBoundsAccurate(attribute, circleTheme, aabbBounds, graphic) {
|
|
458
|
-
const {startAngle: startAngle = circleTheme.startAngle, endAngle: endAngle = circleTheme.endAngle, radius: radius = circleTheme.radius} = attribute;
|
|
459
|
-
return endAngle - startAngle > pi2 - epsilon ? aabbBounds.set(-radius, -radius, radius, radius) : circleBounds(startAngle, endAngle, radius, aabbBounds),
|
|
460
|
-
aabbBounds;
|
|
461
|
-
}
|
|
462
|
-
updateArcAABBBounds(attribute, arcTheme, aabbBounds, full, graphic) {
|
|
463
|
-
if (!this._validCheck(attribute, arcTheme, aabbBounds, graphic)) return aabbBounds;
|
|
464
|
-
this.updatePathProxyAABBBounds(aabbBounds, graphic) || (full ? this.updateArcAABBBoundsImprecise(attribute, arcTheme, aabbBounds, graphic) : this.updateArcAABBBoundsAccurate(attribute, arcTheme, aabbBounds, graphic));
|
|
465
|
-
const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
|
|
466
|
-
tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2),
|
|
467
|
-
this._arcBoundsContribitions.length && this._arcBoundsContribitions.forEach((c => {
|
|
468
|
-
c.updateBounds(attribute, arcTheme, tb1, graphic), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
|
|
469
|
-
}));
|
|
470
|
-
const {lineJoin: lineJoin = arcTheme.lineJoin} = attribute;
|
|
471
|
-
return this.transformAABBBounds(attribute, aabbBounds, arcTheme, "miter" === lineJoin, graphic),
|
|
472
|
-
aabbBounds;
|
|
473
|
-
}
|
|
474
|
-
updateArcAABBBoundsImprecise(attribute, arcTheme, aabbBounds, graphic) {
|
|
475
|
-
let {outerRadius: outerRadius = arcTheme.outerRadius, innerRadius: innerRadius = arcTheme.innerRadius} = attribute;
|
|
476
|
-
const {outerPadding: outerPadding = arcTheme.outerPadding, innerPadding: innerPadding = arcTheme.innerPadding} = attribute;
|
|
477
|
-
return outerRadius += outerPadding, innerRadius -= innerPadding, outerRadius < innerRadius && (outerRadius = innerRadius),
|
|
478
|
-
aabbBounds.set(-outerRadius, -outerRadius, outerRadius, outerRadius), aabbBounds;
|
|
479
|
-
}
|
|
480
|
-
updateArcAABBBoundsAccurate(attribute, arcTheme, aabbBounds, graphic) {
|
|
481
|
-
let {outerRadius: outerRadius = arcTheme.outerRadius, innerRadius: innerRadius = arcTheme.innerRadius} = attribute;
|
|
482
|
-
const {outerPadding: outerPadding = arcTheme.outerPadding, innerPadding: innerPadding = arcTheme.innerPadding} = attribute;
|
|
483
|
-
if (outerRadius += outerPadding, innerRadius -= innerPadding, outerRadius < innerRadius) {
|
|
484
|
-
const temp = outerRadius;
|
|
485
|
-
outerRadius = innerRadius, innerRadius = temp;
|
|
486
|
-
}
|
|
487
|
-
let {endAngle: endAngle = arcTheme.endAngle, startAngle: startAngle = arcTheme.startAngle} = attribute;
|
|
488
|
-
if (startAngle > endAngle) {
|
|
489
|
-
const temp = startAngle;
|
|
490
|
-
startAngle = endAngle, endAngle = temp;
|
|
491
|
-
}
|
|
492
|
-
return outerRadius <= epsilon ? aabbBounds.set(0, 0, 0, 0) : Math.abs(endAngle - startAngle) > pi2 - epsilon ? aabbBounds.set(-outerRadius, -outerRadius, outerRadius, outerRadius) : (circleBounds(startAngle, endAngle, outerRadius, aabbBounds),
|
|
493
|
-
circleBounds(startAngle, endAngle, innerRadius, aabbBounds)), aabbBounds;
|
|
494
|
-
}
|
|
495
|
-
updateSymbolAABBBounds(attribute, symbolTheme, aabbBounds, full, graphic) {
|
|
496
|
-
if (!this._validCheck(attribute, symbolTheme, aabbBounds, graphic)) return aabbBounds;
|
|
497
|
-
this.updatePathProxyAABBBounds(aabbBounds, graphic) || (full ? this.updateSymbolAABBBoundsImprecise(attribute, symbolTheme, aabbBounds, graphic) : this.updateSymbolAABBBoundsAccurate(attribute, symbolTheme, aabbBounds, graphic));
|
|
498
|
-
const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
|
|
499
|
-
tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2),
|
|
500
|
-
this._symbolBoundsContribitions.length && this._symbolBoundsContribitions.forEach((c => {
|
|
501
|
-
c.updateBounds(attribute, symbolTheme, tb1, graphic), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
|
|
502
|
-
}));
|
|
503
|
-
const {lineJoin: lineJoin = symbolTheme.lineJoin} = attribute;
|
|
504
|
-
return this.transformAABBBounds(attribute, aabbBounds, symbolTheme, "miter" === lineJoin, graphic),
|
|
505
|
-
aabbBounds;
|
|
506
|
-
}
|
|
507
|
-
updateSymbolAABBBoundsImprecise(attribute, symbolTheme, aabbBounds, graphic) {
|
|
508
|
-
const {size: size = symbolTheme.size} = attribute;
|
|
509
|
-
if (isArray(size)) aabbBounds.set(-size[0] / 2, -size[1] / 2, size[0] / 2, size[1] / 2); else {
|
|
510
|
-
const halfWH = size / 2;
|
|
511
|
-
aabbBounds.set(-halfWH, -halfWH, halfWH, halfWH);
|
|
512
|
-
}
|
|
513
|
-
return aabbBounds;
|
|
514
|
-
}
|
|
515
|
-
updateSymbolAABBBoundsAccurate(attribute, symbolTheme, aabbBounds, graphic) {
|
|
516
|
-
if (!graphic) return aabbBounds;
|
|
517
|
-
const {size: size = symbolTheme.size} = attribute;
|
|
518
|
-
return graphic.getParsedPath().bounds(size, aabbBounds), aabbBounds;
|
|
519
|
-
}
|
|
520
|
-
updateImageAABBBounds(attribute, imageTheme, aabbBounds, graphic) {
|
|
521
|
-
if (!this._validCheck(attribute, imageTheme, aabbBounds, graphic)) return aabbBounds;
|
|
522
|
-
if (!this.updatePathProxyAABBBounds(aabbBounds, graphic)) {
|
|
523
|
-
const {width: width = imageTheme.width, height: height = imageTheme.height} = attribute;
|
|
524
|
-
aabbBounds.set(0, 0, width, height);
|
|
525
|
-
}
|
|
526
|
-
const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
|
|
527
|
-
return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2),
|
|
528
|
-
tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this._imageBoundsContribitions.length && this._imageBoundsContribitions.forEach((c => {
|
|
529
|
-
c.updateBounds(attribute, imageTheme, tb1, graphic), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
|
|
530
|
-
})), this.transformAABBBounds(attribute, aabbBounds, imageTheme, !1, graphic), aabbBounds;
|
|
531
|
-
}
|
|
532
150
|
combindShadowAABBBounds(bounds, graphic) {
|
|
533
151
|
if (graphic && graphic.shadowRoot) {
|
|
534
152
|
const b = graphic.shadowRoot.AABBBounds;
|
|
@@ -555,13 +173,21 @@ let DefaultGraphicService = class {
|
|
|
555
173
|
graphic && graphic.isContainer && (updateMatrix = !(1 === m.a && 0 === m.b && 0 === m.c && 1 === m.d && 0 === m.e && 0 === m.f)),
|
|
556
174
|
updateMatrix && transformBoundsWithMatrix(aabbBounds, aabbBounds, m);
|
|
557
175
|
}
|
|
558
|
-
|
|
176
|
+
validCheck(attribute, theme, aabbBounds, graphic) {
|
|
559
177
|
if (!graphic) return !0;
|
|
560
178
|
if (null != attribute.forceBoundsHeight || null != attribute.forceBoundsWidth) return !0;
|
|
561
179
|
if (!graphic.valid) return aabbBounds.clear(), !1;
|
|
562
180
|
const {visible: visible = theme.visible} = attribute;
|
|
563
181
|
return !!visible || (aabbBounds.clear(), !1);
|
|
564
182
|
}
|
|
183
|
+
updateTempAABBBounds(aabbBounds) {
|
|
184
|
+
const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
|
|
185
|
+
return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2),
|
|
186
|
+
tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), {
|
|
187
|
+
tb1: tb1,
|
|
188
|
+
tb2: tb2
|
|
189
|
+
};
|
|
190
|
+
}
|
|
565
191
|
};
|
|
566
192
|
|
|
567
193
|
DefaultGraphicService = __decorate([ injectable(), __param(0, inject(GraphicCreator)), __metadata("design:paramtypes", [ Object ]) ], DefaultGraphicService);
|