@visactor/vrender-kits 0.16.0-alpha.6 → 0.16.0
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/canvas/contributions/browser/canvas.d.ts +17 -0
- package/cjs/canvas/contributions/browser/canvas.js +73 -0
- package/cjs/canvas/contributions/browser/canvas.js.map +1 -0
- package/cjs/canvas/contributions/browser/context.d.ts +176 -0
- package/cjs/canvas/contributions/browser/context.js +495 -0
- package/cjs/canvas/contributions/browser/context.js.map +1 -0
- package/cjs/canvas/contributions/browser/index.d.ts +2 -0
- package/cjs/canvas/contributions/browser/index.js +21 -0
- package/cjs/canvas/contributions/browser/index.js.map +1 -0
- package/cjs/canvas/contributions/browser/modules.d.ts +1 -0
- package/cjs/canvas/contributions/browser/modules.js +10 -0
- package/cjs/canvas/contributions/browser/modules.js.map +1 -0
- package/cjs/canvas/contributions/create-canvas-module.d.ts +2 -0
- package/cjs/canvas/contributions/create-canvas-module.js +17 -0
- package/cjs/canvas/contributions/create-canvas-module.js.map +1 -0
- package/cjs/canvas/contributions/feishu/canvas.d.ts +8 -0
- package/cjs/canvas/contributions/feishu/canvas.js +28 -0
- package/cjs/canvas/contributions/feishu/canvas.js.map +1 -0
- package/cjs/canvas/contributions/feishu/context.d.ts +12 -0
- package/cjs/canvas/contributions/feishu/context.js +56 -0
- package/cjs/canvas/contributions/feishu/context.js.map +1 -0
- package/cjs/canvas/contributions/feishu/index.d.ts +2 -0
- package/cjs/canvas/contributions/feishu/index.js +21 -0
- package/cjs/canvas/contributions/feishu/index.js.map +1 -0
- package/cjs/canvas/contributions/feishu/modules.d.ts +1 -0
- package/cjs/canvas/contributions/feishu/modules.js +10 -0
- package/cjs/canvas/contributions/feishu/modules.js.map +1 -0
- package/cjs/canvas/contributions/lynx/canvas.d.ts +8 -0
- package/cjs/canvas/contributions/lynx/canvas.js +29 -0
- package/cjs/canvas/contributions/lynx/canvas.js.map +1 -0
- package/cjs/canvas/contributions/lynx/context.d.ts +13 -0
- package/cjs/canvas/contributions/lynx/context.js +57 -0
- package/cjs/canvas/contributions/lynx/context.js.map +1 -0
- package/cjs/canvas/contributions/lynx/index.d.ts +2 -0
- package/cjs/canvas/contributions/lynx/index.js +21 -0
- package/cjs/canvas/contributions/lynx/index.js.map +1 -0
- package/cjs/canvas/contributions/lynx/modules.d.ts +1 -0
- package/cjs/canvas/contributions/lynx/modules.js +10 -0
- package/cjs/canvas/contributions/lynx/modules.js.map +1 -0
- package/cjs/canvas/contributions/modules.d.ts +9 -0
- package/cjs/canvas/contributions/modules.js +48 -0
- package/cjs/canvas/contributions/modules.js.map +1 -0
- package/cjs/canvas/contributions/node/canvas.d.ts +8 -1
- package/cjs/canvas/contributions/node/canvas.js +30 -0
- package/cjs/canvas/contributions/node/canvas.js.map +1 -1
- package/cjs/canvas/contributions/node/context.d.ts +7 -1
- package/cjs/canvas/contributions/node/context.js +29 -0
- package/cjs/canvas/contributions/node/context.js.map +1 -1
- package/cjs/canvas/contributions/node/index.d.ts +2 -1
- package/cjs/canvas/contributions/node/index.js +20 -0
- package/cjs/canvas/contributions/node/index.js.map +1 -1
- package/cjs/canvas/contributions/node/modules.d.ts +1 -1
- package/cjs/canvas/contributions/node/modules.js +9 -0
- package/cjs/canvas/contributions/node/modules.js.map +1 -1
- package/cjs/canvas/contributions/taro/canvas.d.ts +8 -0
- package/cjs/canvas/contributions/taro/canvas.js +29 -0
- package/cjs/canvas/contributions/taro/canvas.js.map +1 -0
- package/cjs/canvas/contributions/taro/context.d.ts +32 -0
- package/cjs/canvas/contributions/taro/context.js +68 -0
- package/cjs/canvas/contributions/taro/context.js.map +1 -0
- package/cjs/canvas/contributions/taro/index.d.ts +2 -0
- package/cjs/canvas/contributions/taro/index.js +21 -0
- package/cjs/canvas/contributions/taro/index.js.map +1 -0
- package/cjs/canvas/contributions/taro/modules.d.ts +1 -0
- package/cjs/canvas/contributions/taro/modules.js +10 -0
- package/cjs/canvas/contributions/taro/modules.js.map +1 -0
- package/cjs/canvas/contributions/tt/canvas.d.ts +8 -0
- package/cjs/canvas/contributions/tt/canvas.js +29 -0
- package/cjs/canvas/contributions/tt/canvas.js.map +1 -0
- package/cjs/canvas/contributions/tt/context.d.ts +5 -0
- package/cjs/canvas/contributions/tt/context.js +19 -0
- package/cjs/canvas/contributions/tt/context.js.map +1 -0
- package/cjs/canvas/contributions/tt/index.d.ts +2 -0
- package/cjs/canvas/contributions/tt/index.js +21 -0
- package/cjs/canvas/contributions/tt/index.js.map +1 -0
- package/cjs/canvas/contributions/tt/modules.d.ts +1 -0
- package/cjs/canvas/contributions/tt/modules.js +10 -0
- package/cjs/canvas/contributions/tt/modules.js.map +1 -0
- package/cjs/canvas/contributions/wx/canvas.d.ts +8 -0
- package/cjs/canvas/contributions/wx/canvas.js +29 -0
- package/cjs/canvas/contributions/wx/canvas.js.map +1 -0
- package/cjs/canvas/contributions/wx/context.d.ts +7 -0
- package/cjs/canvas/contributions/wx/context.js +24 -0
- package/cjs/canvas/contributions/wx/context.js.map +1 -0
- package/cjs/canvas/contributions/wx/index.d.ts +2 -0
- package/cjs/canvas/contributions/wx/index.js +21 -0
- package/cjs/canvas/contributions/wx/index.js.map +1 -0
- package/cjs/canvas/contributions/wx/modules.d.ts +1 -0
- package/cjs/canvas/contributions/wx/modules.js +10 -0
- package/cjs/canvas/contributions/wx/modules.js.map +1 -0
- package/cjs/canvas/index.d.ts +1 -1
- package/cjs/canvas/index.js +21 -1
- package/cjs/canvas/index.js.map +1 -1
- package/cjs/env/all.d.ts +4 -0
- package/cjs/env/all.js +27 -0
- package/cjs/env/all.js.map +1 -0
- package/cjs/env/browser.d.ts +3 -0
- package/cjs/env/browser.js +19 -0
- package/cjs/env/browser.js.map +1 -0
- package/cjs/env/contributions/browser-contribution.d.ts +42 -0
- package/cjs/env/contributions/browser-contribution.js +198 -0
- package/cjs/env/contributions/browser-contribution.js.map +1 -0
- package/cjs/env/contributions/browser-module.d.ts +2 -0
- package/cjs/env/contributions/browser-module.js +13 -0
- package/cjs/env/contributions/browser-module.js.map +1 -0
- package/cjs/env/contributions/feishu-contribution.d.ts +41 -0
- package/cjs/env/contributions/feishu-contribution.js +116 -0
- package/cjs/env/contributions/feishu-contribution.js.map +1 -0
- package/cjs/env/contributions/feishu-module.d.ts +2 -0
- package/cjs/env/contributions/feishu-module.js +12 -0
- package/cjs/env/contributions/feishu-module.js.map +1 -0
- package/cjs/env/contributions/lynx-contribution.d.ts +41 -0
- package/cjs/env/contributions/lynx-contribution.js +136 -0
- package/cjs/env/contributions/lynx-contribution.js.map +1 -0
- package/cjs/env/contributions/module.d.ts +8 -1
- package/cjs/env/contributions/module.js +25 -1
- package/cjs/env/contributions/module.js.map +1 -1
- package/cjs/env/contributions/node-contribution.d.ts +49 -1
- package/cjs/env/contributions/node-contribution.js +95 -1
- package/cjs/env/contributions/node-contribution.js.map +1 -1
- package/cjs/env/contributions/taro-contribution.d.ts +57 -0
- package/cjs/env/contributions/taro-contribution.js +142 -0
- package/cjs/env/contributions/taro-contribution.js.map +1 -0
- package/cjs/env/contributions/wx-contribution.d.ts +40 -0
- package/cjs/env/contributions/wx-contribution.js +131 -0
- package/cjs/env/contributions/wx-contribution.js.map +1 -0
- package/cjs/env/feishu.d.ts +3 -0
- package/cjs/env/feishu.js +19 -0
- package/cjs/env/feishu.js.map +1 -0
- package/cjs/env/index.d.ts +7 -0
- package/cjs/env/index.js +24 -0
- package/cjs/env/index.js.map +1 -0
- package/cjs/env/lynx.d.ts +3 -0
- package/cjs/env/lynx.js +19 -0
- package/cjs/env/lynx.js.map +1 -0
- package/cjs/env/node.d.ts +3 -0
- package/cjs/env/node.js +19 -0
- package/cjs/env/node.js.map +1 -0
- package/cjs/env/taro.d.ts +3 -0
- package/cjs/env/taro.js +19 -0
- package/cjs/env/taro.js.map +1 -0
- package/cjs/env/wx.d.ts +3 -0
- package/cjs/env/wx.js +19 -0
- package/cjs/env/wx.js.map +1 -0
- package/cjs/event/extension/drag.d.ts +9 -0
- package/cjs/event/extension/drag.js +53 -0
- package/cjs/event/extension/drag.js.map +1 -0
- package/cjs/event/extension/gesture.d.ts +38 -0
- package/cjs/event/extension/gesture.js +181 -0
- package/cjs/event/extension/gesture.js.map +1 -0
- package/cjs/event/extension/index.d.ts +3 -0
- package/cjs/event/extension/index.js +24 -0
- package/cjs/event/extension/index.js.map +1 -0
- package/cjs/index-node.d.ts +1 -2
- package/cjs/index-node.js +1 -1
- package/cjs/index-node.js.map +1 -1
- package/cjs/index.d.ts +5 -2
- package/cjs/index.js +18 -3
- package/cjs/index.js.map +1 -1
- package/cjs/jsx/graphicType.d.ts +171 -0
- package/cjs/jsx/graphicType.js +133 -0
- package/cjs/jsx/graphicType.js.map +1 -0
- package/cjs/jsx/index.d.ts +2 -0
- package/cjs/jsx/index.js +21 -0
- package/cjs/jsx/index.js.map +1 -0
- package/cjs/jsx/jsx-classic.d.ts +3 -0
- package/cjs/jsx/jsx-classic.js +58 -0
- package/cjs/jsx/jsx-classic.js.map +1 -0
- package/cjs/picker/canvas-module.d.ts +4 -0
- package/cjs/picker/canvas-module.js +23 -0
- package/cjs/picker/canvas-module.js.map +1 -0
- package/cjs/picker/canvas-picker-service.d.ts +28 -0
- package/cjs/picker/canvas-picker-service.js +91 -0
- package/cjs/picker/canvas-picker-service.js.map +1 -0
- package/cjs/picker/contributions/canvas-picker/arc-picker.d.ts +9 -0
- package/cjs/picker/contributions/canvas-picker/arc-picker.js +51 -0
- package/cjs/picker/contributions/canvas-picker/arc-picker.js.map +1 -0
- package/cjs/picker/contributions/canvas-picker/arc3d-picker.d.ts +10 -0
- package/cjs/picker/contributions/canvas-picker/arc3d-picker.js +50 -0
- package/cjs/picker/contributions/canvas-picker/arc3d-picker.js.map +1 -0
- package/cjs/picker/contributions/canvas-picker/area-picker.d.ts +9 -0
- package/cjs/picker/contributions/canvas-picker/area-picker.js +45 -0
- package/cjs/picker/contributions/canvas-picker/area-picker.js.map +1 -0
- package/cjs/picker/contributions/canvas-picker/base-picker.d.ts +4 -0
- package/cjs/picker/contributions/canvas-picker/base-picker.js +18 -0
- package/cjs/picker/contributions/canvas-picker/base-picker.js.map +1 -0
- package/cjs/picker/contributions/canvas-picker/circle-picker.d.ts +9 -0
- package/cjs/picker/contributions/canvas-picker/circle-picker.js +50 -0
- package/cjs/picker/contributions/canvas-picker/circle-picker.js.map +1 -0
- package/cjs/picker/contributions/canvas-picker/glyph-picker.d.ts +9 -0
- package/cjs/picker/contributions/canvas-picker/glyph-picker.js +46 -0
- package/cjs/picker/contributions/canvas-picker/glyph-picker.js.map +1 -0
- package/cjs/picker/contributions/canvas-picker/group-picker.d.ts +7 -0
- package/cjs/picker/contributions/canvas-picker/group-picker.js +26 -0
- package/cjs/picker/contributions/canvas-picker/group-picker.js.map +1 -0
- package/cjs/picker/contributions/canvas-picker/image-picker.d.ts +7 -0
- package/cjs/picker/contributions/canvas-picker/image-picker.js +27 -0
- package/cjs/picker/contributions/canvas-picker/image-picker.js.map +1 -0
- package/cjs/picker/contributions/canvas-picker/line-picker.d.ts +10 -0
- package/cjs/picker/contributions/canvas-picker/line-picker.js +56 -0
- package/cjs/picker/contributions/canvas-picker/line-picker.js.map +1 -0
- package/cjs/picker/contributions/canvas-picker/module.d.ts +3 -0
- package/cjs/picker/contributions/canvas-picker/module.js +46 -0
- package/cjs/picker/contributions/canvas-picker/module.js.map +1 -0
- package/cjs/picker/contributions/canvas-picker/path-picker.d.ts +10 -0
- package/cjs/picker/contributions/canvas-picker/path-picker.js +57 -0
- package/cjs/picker/contributions/canvas-picker/path-picker.js.map +1 -0
- package/cjs/picker/contributions/canvas-picker/polygon-picker.d.ts +9 -0
- package/cjs/picker/contributions/canvas-picker/polygon-picker.js +49 -0
- package/cjs/picker/contributions/canvas-picker/polygon-picker.js.map +1 -0
- package/cjs/picker/contributions/canvas-picker/pyramid3d-picker.d.ts +10 -0
- package/cjs/picker/contributions/canvas-picker/pyramid3d-picker.js +51 -0
- package/cjs/picker/contributions/canvas-picker/pyramid3d-picker.js.map +1 -0
- package/cjs/picker/contributions/canvas-picker/rect-picker.d.ts +9 -0
- package/cjs/picker/contributions/canvas-picker/rect-picker.js +62 -0
- package/cjs/picker/contributions/canvas-picker/rect-picker.js.map +1 -0
- package/cjs/picker/contributions/canvas-picker/rect3d-picker.d.ts +10 -0
- package/cjs/picker/contributions/canvas-picker/rect3d-picker.js +50 -0
- package/cjs/picker/contributions/canvas-picker/rect3d-picker.js.map +1 -0
- package/cjs/picker/contributions/canvas-picker/richtext-picker.d.ts +9 -0
- package/cjs/picker/contributions/canvas-picker/richtext-picker.js +33 -0
- package/cjs/picker/contributions/canvas-picker/richtext-picker.js.map +1 -0
- package/cjs/picker/contributions/canvas-picker/symbol-picker.d.ts +10 -0
- package/cjs/picker/contributions/canvas-picker/symbol-picker.js +59 -0
- package/cjs/picker/contributions/canvas-picker/symbol-picker.js.map +1 -0
- package/cjs/picker/contributions/canvas-picker/text-picker.d.ts +10 -0
- package/cjs/picker/contributions/canvas-picker/text-picker.js +58 -0
- package/cjs/picker/contributions/canvas-picker/text-picker.js.map +1 -0
- package/cjs/picker/contributions/constants.d.ts +29 -0
- package/cjs/picker/contributions/constants.js +21 -0
- package/cjs/picker/contributions/constants.js.map +1 -0
- package/cjs/picker/contributions/math-picker/arc-picker.d.ts +9 -0
- package/cjs/picker/contributions/math-picker/arc-picker.js +51 -0
- package/cjs/picker/contributions/math-picker/arc-picker.js.map +1 -0
- package/cjs/picker/contributions/math-picker/area-picker.d.ts +9 -0
- package/cjs/picker/contributions/math-picker/area-picker.js +45 -0
- package/cjs/picker/contributions/math-picker/area-picker.js.map +1 -0
- package/cjs/picker/contributions/math-picker/circle-picker.d.ts +9 -0
- package/cjs/picker/contributions/math-picker/circle-picker.js +50 -0
- package/cjs/picker/contributions/math-picker/circle-picker.js.map +1 -0
- package/cjs/picker/contributions/math-picker/glyph-picker.d.ts +9 -0
- package/cjs/picker/contributions/math-picker/glyph-picker.js +44 -0
- package/cjs/picker/contributions/math-picker/glyph-picker.js.map +1 -0
- package/cjs/picker/contributions/math-picker/line-picker.d.ts +9 -0
- package/cjs/picker/contributions/math-picker/line-picker.js +50 -0
- package/cjs/picker/contributions/math-picker/line-picker.js.map +1 -0
- package/cjs/picker/contributions/math-picker/module.d.ts +3 -0
- package/cjs/picker/contributions/math-picker/module.js +32 -0
- package/cjs/picker/contributions/math-picker/module.js.map +1 -0
- package/cjs/picker/contributions/math-picker/path-picker.d.ts +9 -0
- package/cjs/picker/contributions/math-picker/path-picker.js +50 -0
- package/cjs/picker/contributions/math-picker/path-picker.js.map +1 -0
- package/cjs/picker/contributions/math-picker/polygon-picker.d.ts +9 -0
- package/cjs/picker/contributions/math-picker/polygon-picker.js +49 -0
- package/cjs/picker/contributions/math-picker/polygon-picker.js.map +1 -0
- package/cjs/picker/contributions/math-picker/rect-picker.d.ts +9 -0
- package/cjs/picker/contributions/math-picker/rect-picker.js +62 -0
- package/cjs/picker/contributions/math-picker/rect-picker.js.map +1 -0
- package/cjs/picker/contributions/math-picker/symbol-picker.d.ts +9 -0
- package/cjs/picker/contributions/math-picker/symbol-picker.js +50 -0
- package/cjs/picker/contributions/math-picker/symbol-picker.js.map +1 -0
- package/cjs/picker/contributions/math-picker/text-picker.d.ts +7 -0
- package/cjs/picker/contributions/math-picker/text-picker.js +26 -0
- package/cjs/picker/contributions/math-picker/text-picker.js.map +1 -0
- package/cjs/picker/index.d.ts +1 -0
- package/cjs/picker/index.js +21 -0
- package/cjs/picker/index.js.map +1 -0
- package/cjs/picker/math-module.d.ts +4 -0
- package/cjs/picker/math-module.js +23 -0
- package/cjs/picker/math-module.js.map +1 -0
- package/cjs/picker/math-picker-service.d.ts +16 -0
- package/cjs/picker/math-picker-service.js +54 -0
- package/cjs/picker/math-picker-service.js.map +1 -0
- package/cjs/picker/module.d.ts +6 -0
- package/cjs/picker/module.js +30 -0
- package/cjs/picker/module.js.map +1 -0
- package/cjs/render/contributions/rough/config.js +1 -1
- package/cjs/render/contributions/rough/module.d.ts +1 -1
- package/cjs/render/contributions/rough/module.js +10 -10
- package/cjs/render/contributions/rough/module.js.map +1 -1
- package/cjs/render/contributions/rough/rough-arc.d.ts +1 -1
- package/cjs/render/contributions/rough/rough-arc.js +10 -8
- package/cjs/render/contributions/rough/rough-arc.js.map +1 -1
- package/cjs/render/contributions/rough/rough-area.d.ts +2 -2
- package/cjs/render/contributions/rough/rough-area.js +6 -6
- package/cjs/render/contributions/rough/rough-area.js.map +1 -1
- package/cjs/render/contributions/rough/rough-circle.d.ts +1 -1
- package/cjs/render/contributions/rough/rough-circle.js +6 -6
- package/cjs/render/contributions/rough/rough-circle.js.map +1 -1
- package/cjs/render/contributions/rough/rough-line.d.ts +2 -2
- package/cjs/render/contributions/rough/rough-line.js +6 -6
- package/cjs/render/contributions/rough/rough-line.js.map +1 -1
- package/cjs/render/contributions/rough/rough-path.d.ts +1 -1
- package/cjs/render/contributions/rough/rough-path.js +6 -6
- package/cjs/render/contributions/rough/rough-path.js.map +1 -1
- package/cjs/render/contributions/rough/rough-rect.d.ts +1 -1
- package/cjs/render/contributions/rough/rough-rect.js +6 -6
- package/cjs/render/contributions/rough/rough-rect.js.map +1 -1
- package/cjs/render/contributions/rough/rough-symbol.d.ts +2 -2
- package/cjs/render/contributions/rough/rough-symbol.js +8 -8
- package/cjs/render/contributions/rough/rough-symbol.js.map +1 -1
- package/cjs/window/contributions/browser-contribution.d.ts +49 -0
- package/cjs/window/contributions/browser-contribution.js +178 -0
- package/cjs/window/contributions/browser-contribution.js.map +1 -0
- package/cjs/window/contributions/feishu-contribution.d.ts +47 -0
- package/cjs/window/contributions/feishu-contribution.js +159 -0
- package/cjs/window/contributions/feishu-contribution.js.map +1 -0
- package/cjs/window/contributions/lynx-contribution.d.ts +47 -0
- package/cjs/window/contributions/lynx-contribution.js +159 -0
- package/cjs/window/contributions/lynx-contribution.js.map +1 -0
- package/cjs/window/contributions/native-contribution.js +1 -0
- package/cjs/window/contributions/native-contribution.js.map +1 -0
- package/cjs/window/contributions/node-contribution.d.ts +40 -1
- package/cjs/window/contributions/node-contribution.js +111 -1
- package/cjs/window/contributions/node-contribution.js.map +1 -1
- package/cjs/window/contributions/taro-contribution.d.ts +47 -0
- package/cjs/window/contributions/taro-contribution.js +166 -0
- package/cjs/window/contributions/taro-contribution.js.map +1 -0
- package/cjs/window/contributions/wx-contribution.d.ts +47 -0
- package/cjs/window/contributions/wx-contribution.js +161 -0
- package/cjs/window/contributions/wx-contribution.js.map +1 -0
- package/dist/index.js +5711 -44
- package/dist/index.min.js +1 -1
- package/es/canvas/contributions/browser/canvas.d.ts +17 -0
- package/es/canvas/contributions/browser/canvas.js +70 -0
- package/es/canvas/contributions/browser/canvas.js.map +1 -0
- package/es/canvas/contributions/browser/context.d.ts +176 -0
- package/es/canvas/contributions/browser/context.js +490 -0
- package/es/canvas/contributions/browser/context.js.map +1 -0
- package/es/canvas/contributions/browser/index.d.ts +2 -0
- package/es/canvas/contributions/browser/index.js +4 -0
- package/es/canvas/contributions/browser/index.js.map +1 -0
- package/es/canvas/contributions/browser/modules.d.ts +1 -0
- package/es/canvas/contributions/browser/modules.js +8 -0
- package/es/canvas/contributions/browser/modules.js.map +1 -0
- package/es/canvas/contributions/create-canvas-module.d.ts +2 -0
- package/es/canvas/contributions/create-canvas-module.js +9 -0
- package/es/canvas/contributions/create-canvas-module.js.map +1 -0
- package/es/canvas/contributions/feishu/canvas.d.ts +8 -0
- package/es/canvas/contributions/feishu/canvas.js +25 -0
- package/es/canvas/contributions/feishu/canvas.js.map +1 -0
- package/es/canvas/contributions/feishu/context.d.ts +12 -0
- package/es/canvas/contributions/feishu/context.js +53 -0
- package/es/canvas/contributions/feishu/context.js.map +1 -0
- package/es/canvas/contributions/feishu/index.d.ts +2 -0
- package/es/canvas/contributions/feishu/index.js +4 -0
- package/es/canvas/contributions/feishu/index.js.map +1 -0
- package/es/canvas/contributions/feishu/modules.d.ts +1 -0
- package/es/canvas/contributions/feishu/modules.js +8 -0
- package/es/canvas/contributions/feishu/modules.js.map +1 -0
- package/es/canvas/contributions/lynx/canvas.d.ts +8 -0
- package/es/canvas/contributions/lynx/canvas.js +26 -0
- package/es/canvas/contributions/lynx/canvas.js.map +1 -0
- package/es/canvas/contributions/lynx/context.d.ts +13 -0
- package/es/canvas/contributions/lynx/context.js +54 -0
- package/es/canvas/contributions/lynx/context.js.map +1 -0
- package/es/canvas/contributions/lynx/index.d.ts +2 -0
- package/es/canvas/contributions/lynx/index.js +4 -0
- package/es/canvas/contributions/lynx/index.js.map +1 -0
- package/es/canvas/contributions/lynx/modules.d.ts +1 -0
- package/es/canvas/contributions/lynx/modules.js +8 -0
- package/es/canvas/contributions/lynx/modules.js.map +1 -0
- package/es/canvas/contributions/modules.d.ts +9 -0
- package/es/canvas/contributions/modules.js +48 -0
- package/es/canvas/contributions/modules.js.map +1 -0
- package/es/canvas/contributions/node/canvas.d.ts +8 -1
- package/es/canvas/contributions/node/canvas.js +29 -0
- package/es/canvas/contributions/node/canvas.js.map +1 -1
- package/es/canvas/contributions/node/context.d.ts +7 -1
- package/es/canvas/contributions/node/context.js +28 -0
- package/es/canvas/contributions/node/context.js.map +1 -1
- package/es/canvas/contributions/node/index.d.ts +2 -1
- package/es/canvas/contributions/node/index.js +3 -0
- package/es/canvas/contributions/node/index.js.map +1 -1
- package/es/canvas/contributions/node/modules.d.ts +1 -1
- package/es/canvas/contributions/node/modules.js +7 -0
- package/es/canvas/contributions/node/modules.js.map +1 -1
- package/es/canvas/contributions/taro/canvas.d.ts +8 -0
- package/es/canvas/contributions/taro/canvas.js +28 -0
- package/es/canvas/contributions/taro/canvas.js.map +1 -0
- package/es/canvas/contributions/taro/context.d.ts +32 -0
- package/es/canvas/contributions/taro/context.js +64 -0
- package/es/canvas/contributions/taro/context.js.map +1 -0
- package/es/canvas/contributions/taro/index.d.ts +2 -0
- package/es/canvas/contributions/taro/index.js +4 -0
- package/es/canvas/contributions/taro/index.js.map +1 -0
- package/es/canvas/contributions/taro/modules.d.ts +1 -0
- package/es/canvas/contributions/taro/modules.js +8 -0
- package/es/canvas/contributions/taro/modules.js.map +1 -0
- package/es/canvas/contributions/tt/canvas.d.ts +8 -0
- package/es/canvas/contributions/tt/canvas.js +26 -0
- package/es/canvas/contributions/tt/canvas.js.map +1 -0
- package/es/canvas/contributions/tt/context.d.ts +5 -0
- package/es/canvas/contributions/tt/context.js +16 -0
- package/es/canvas/contributions/tt/context.js.map +1 -0
- package/es/canvas/contributions/tt/index.d.ts +2 -0
- package/es/canvas/contributions/tt/index.js +4 -0
- package/es/canvas/contributions/tt/index.js.map +1 -0
- package/es/canvas/contributions/tt/modules.d.ts +1 -0
- package/es/canvas/contributions/tt/modules.js +8 -0
- package/es/canvas/contributions/tt/modules.js.map +1 -0
- package/es/canvas/contributions/wx/canvas.d.ts +8 -0
- package/es/canvas/contributions/wx/canvas.js +26 -0
- package/es/canvas/contributions/wx/canvas.js.map +1 -0
- package/es/canvas/contributions/wx/context.d.ts +7 -0
- package/es/canvas/contributions/wx/context.js +21 -0
- package/es/canvas/contributions/wx/context.js.map +1 -0
- package/es/canvas/contributions/wx/index.d.ts +2 -0
- package/es/canvas/contributions/wx/index.js +4 -0
- package/es/canvas/contributions/wx/index.js.map +1 -0
- package/es/canvas/contributions/wx/modules.d.ts +1 -0
- package/es/canvas/contributions/wx/modules.js +8 -0
- package/es/canvas/contributions/wx/modules.js.map +1 -0
- package/es/canvas/index.d.ts +1 -1
- package/es/canvas/index.js +2 -1
- package/es/canvas/index.js.map +1 -1
- package/es/env/all.d.ts +4 -0
- package/es/env/all.js +34 -0
- package/es/env/all.js.map +1 -0
- package/es/env/browser.d.ts +3 -0
- package/es/env/browser.js +19 -0
- package/es/env/browser.js.map +1 -0
- package/es/env/contributions/browser-contribution.d.ts +42 -0
- package/es/env/contributions/browser-contribution.js +193 -0
- package/es/env/contributions/browser-contribution.js.map +1 -0
- package/es/env/contributions/browser-module.d.ts +2 -0
- package/es/env/contributions/browser-module.js +8 -0
- package/es/env/contributions/browser-module.js.map +1 -0
- package/es/env/contributions/feishu-contribution.d.ts +41 -0
- package/es/env/contributions/feishu-contribution.js +111 -0
- package/es/env/contributions/feishu-contribution.js.map +1 -0
- package/es/env/contributions/feishu-module.d.ts +2 -0
- package/es/env/contributions/feishu-module.js +8 -0
- package/es/env/contributions/feishu-module.js.map +1 -0
- package/es/env/contributions/lynx-contribution.d.ts +41 -0
- package/es/env/contributions/lynx-contribution.js +129 -0
- package/es/env/contributions/lynx-contribution.js.map +1 -0
- package/es/env/contributions/module.d.ts +8 -1
- package/es/env/contributions/module.js +42 -1
- package/es/env/contributions/module.js.map +1 -1
- package/es/env/contributions/node-contribution.d.ts +49 -1
- package/es/env/contributions/node-contribution.js +90 -1
- package/es/env/contributions/node-contribution.js.map +1 -1
- package/es/env/contributions/taro-contribution.d.ts +57 -0
- package/es/env/contributions/taro-contribution.js +137 -0
- package/es/env/contributions/taro-contribution.js.map +1 -0
- package/es/env/contributions/wx-contribution.d.ts +40 -0
- package/es/env/contributions/wx-contribution.js +126 -0
- package/es/env/contributions/wx-contribution.js.map +1 -0
- package/es/env/feishu.d.ts +3 -0
- package/es/env/feishu.js +19 -0
- package/es/env/feishu.js.map +1 -0
- package/es/env/index.d.ts +7 -0
- package/es/env/index.js +14 -0
- package/es/env/index.js.map +1 -0
- package/es/env/lynx.d.ts +3 -0
- package/es/env/lynx.js +19 -0
- package/es/env/lynx.js.map +1 -0
- package/es/env/node.d.ts +3 -0
- package/es/env/node.js +19 -0
- package/es/env/node.js.map +1 -0
- package/es/env/taro.d.ts +3 -0
- package/es/env/taro.js +19 -0
- package/es/env/taro.js.map +1 -0
- package/es/env/wx.d.ts +3 -0
- package/es/env/wx.js +19 -0
- package/es/env/wx.js.map +1 -0
- package/es/event/extension/drag.d.ts +9 -0
- package/es/event/extension/drag.js +45 -0
- package/es/event/extension/drag.js.map +1 -0
- package/es/event/extension/gesture.d.ts +38 -0
- package/es/event/extension/gesture.js +177 -0
- package/es/event/extension/gesture.js.map +1 -0
- package/es/event/extension/index.d.ts +3 -0
- package/es/event/extension/index.js +6 -0
- package/es/event/extension/index.js.map +1 -0
- package/es/index-node.d.ts +1 -2
- package/es/index-node.js +0 -2
- package/es/index-node.js.map +1 -1
- package/es/index.d.ts +5 -2
- package/es/index.js +8 -2
- package/es/index.js.map +1 -1
- package/es/jsx/graphicType.d.ts +171 -0
- package/es/jsx/graphicType.js +126 -0
- package/es/jsx/graphicType.js.map +1 -0
- package/es/jsx/index.d.ts +2 -0
- package/es/jsx/index.js +4 -0
- package/es/jsx/index.js.map +1 -0
- package/es/jsx/jsx-classic.d.ts +3 -0
- package/es/jsx/jsx-classic.js +56 -0
- package/es/jsx/jsx-classic.js.map +1 -0
- package/es/picker/canvas-module.d.ts +4 -0
- package/es/picker/canvas-module.js +15 -0
- package/es/picker/canvas-module.js.map +1 -0
- package/es/picker/canvas-picker-service.d.ts +28 -0
- package/es/picker/canvas-picker-service.js +79 -0
- package/es/picker/canvas-picker-service.js.map +1 -0
- package/es/picker/contributions/canvas-picker/arc-picker.d.ts +9 -0
- package/es/picker/contributions/canvas-picker/arc-picker.js +45 -0
- package/es/picker/contributions/canvas-picker/arc-picker.js.map +1 -0
- package/es/picker/contributions/canvas-picker/arc3d-picker.d.ts +10 -0
- package/es/picker/contributions/canvas-picker/arc3d-picker.js +46 -0
- package/es/picker/contributions/canvas-picker/arc3d-picker.js.map +1 -0
- package/es/picker/contributions/canvas-picker/area-picker.d.ts +9 -0
- package/es/picker/contributions/canvas-picker/area-picker.js +39 -0
- package/es/picker/contributions/canvas-picker/area-picker.js.map +1 -0
- package/es/picker/contributions/canvas-picker/base-picker.d.ts +4 -0
- package/es/picker/contributions/canvas-picker/base-picker.js +14 -0
- package/es/picker/contributions/canvas-picker/base-picker.js.map +1 -0
- package/es/picker/contributions/canvas-picker/circle-picker.d.ts +9 -0
- package/es/picker/contributions/canvas-picker/circle-picker.js +44 -0
- package/es/picker/contributions/canvas-picker/circle-picker.js.map +1 -0
- package/es/picker/contributions/canvas-picker/glyph-picker.d.ts +9 -0
- package/es/picker/contributions/canvas-picker/glyph-picker.js +40 -0
- package/es/picker/contributions/canvas-picker/glyph-picker.js.map +1 -0
- package/es/picker/contributions/canvas-picker/group-picker.d.ts +7 -0
- package/es/picker/contributions/canvas-picker/group-picker.js +21 -0
- package/es/picker/contributions/canvas-picker/group-picker.js.map +1 -0
- package/es/picker/contributions/canvas-picker/image-picker.d.ts +7 -0
- package/es/picker/contributions/canvas-picker/image-picker.js +22 -0
- package/es/picker/contributions/canvas-picker/image-picker.js.map +1 -0
- package/es/picker/contributions/canvas-picker/line-picker.d.ts +10 -0
- package/es/picker/contributions/canvas-picker/line-picker.js +52 -0
- package/es/picker/contributions/canvas-picker/line-picker.js.map +1 -0
- package/es/picker/contributions/canvas-picker/module.d.ts +3 -0
- package/es/picker/contributions/canvas-picker/module.js +64 -0
- package/es/picker/contributions/canvas-picker/module.js.map +1 -0
- package/es/picker/contributions/canvas-picker/path-picker.d.ts +10 -0
- package/es/picker/contributions/canvas-picker/path-picker.js +53 -0
- package/es/picker/contributions/canvas-picker/path-picker.js.map +1 -0
- package/es/picker/contributions/canvas-picker/polygon-picker.d.ts +9 -0
- package/es/picker/contributions/canvas-picker/polygon-picker.js +43 -0
- package/es/picker/contributions/canvas-picker/polygon-picker.js.map +1 -0
- package/es/picker/contributions/canvas-picker/pyramid3d-picker.d.ts +10 -0
- package/es/picker/contributions/canvas-picker/pyramid3d-picker.js +47 -0
- package/es/picker/contributions/canvas-picker/pyramid3d-picker.js.map +1 -0
- package/es/picker/contributions/canvas-picker/rect-picker.d.ts +9 -0
- package/es/picker/contributions/canvas-picker/rect-picker.js +59 -0
- package/es/picker/contributions/canvas-picker/rect-picker.js.map +1 -0
- package/es/picker/contributions/canvas-picker/rect3d-picker.d.ts +10 -0
- package/es/picker/contributions/canvas-picker/rect3d-picker.js +50 -0
- package/es/picker/contributions/canvas-picker/rect3d-picker.js.map +1 -0
- package/es/picker/contributions/canvas-picker/richtext-picker.d.ts +9 -0
- package/es/picker/contributions/canvas-picker/richtext-picker.js +27 -0
- package/es/picker/contributions/canvas-picker/richtext-picker.js.map +1 -0
- package/es/picker/contributions/canvas-picker/symbol-picker.d.ts +10 -0
- package/es/picker/contributions/canvas-picker/symbol-picker.js +55 -0
- package/es/picker/contributions/canvas-picker/symbol-picker.js.map +1 -0
- package/es/picker/contributions/canvas-picker/text-picker.d.ts +10 -0
- package/es/picker/contributions/canvas-picker/text-picker.js +52 -0
- package/es/picker/contributions/canvas-picker/text-picker.js.map +1 -0
- package/es/picker/contributions/constants.d.ts +29 -0
- package/es/picker/contributions/constants.js +58 -0
- package/es/picker/contributions/constants.js.map +1 -0
- package/es/picker/contributions/math-picker/arc-picker.d.ts +9 -0
- package/es/picker/contributions/math-picker/arc-picker.js +45 -0
- package/es/picker/contributions/math-picker/arc-picker.js.map +1 -0
- package/es/picker/contributions/math-picker/area-picker.d.ts +9 -0
- package/es/picker/contributions/math-picker/area-picker.js +39 -0
- package/es/picker/contributions/math-picker/area-picker.js.map +1 -0
- package/es/picker/contributions/math-picker/circle-picker.d.ts +9 -0
- package/es/picker/contributions/math-picker/circle-picker.js +44 -0
- package/es/picker/contributions/math-picker/circle-picker.js.map +1 -0
- package/es/picker/contributions/math-picker/glyph-picker.d.ts +9 -0
- package/es/picker/contributions/math-picker/glyph-picker.js +38 -0
- package/es/picker/contributions/math-picker/glyph-picker.js.map +1 -0
- package/es/picker/contributions/math-picker/line-picker.d.ts +9 -0
- package/es/picker/contributions/math-picker/line-picker.js +44 -0
- package/es/picker/contributions/math-picker/line-picker.js.map +1 -0
- package/es/picker/contributions/math-picker/module.d.ts +3 -0
- package/es/picker/contributions/math-picker/module.js +43 -0
- package/es/picker/contributions/math-picker/module.js.map +1 -0
- package/es/picker/contributions/math-picker/path-picker.d.ts +9 -0
- package/es/picker/contributions/math-picker/path-picker.js +44 -0
- package/es/picker/contributions/math-picker/path-picker.js.map +1 -0
- package/es/picker/contributions/math-picker/polygon-picker.d.ts +9 -0
- package/es/picker/contributions/math-picker/polygon-picker.js +43 -0
- package/es/picker/contributions/math-picker/polygon-picker.js.map +1 -0
- package/es/picker/contributions/math-picker/rect-picker.d.ts +9 -0
- package/es/picker/contributions/math-picker/rect-picker.js +59 -0
- package/es/picker/contributions/math-picker/rect-picker.js.map +1 -0
- package/es/picker/contributions/math-picker/symbol-picker.d.ts +9 -0
- package/es/picker/contributions/math-picker/symbol-picker.js +44 -0
- package/es/picker/contributions/math-picker/symbol-picker.js.map +1 -0
- package/es/picker/contributions/math-picker/text-picker.d.ts +7 -0
- package/es/picker/contributions/math-picker/text-picker.js +21 -0
- package/es/picker/contributions/math-picker/text-picker.js.map +1 -0
- package/es/picker/index.d.ts +1 -0
- package/es/picker/index.js +2 -0
- package/es/picker/index.js.map +1 -0
- package/es/picker/math-module.d.ts +4 -0
- package/es/picker/math-module.js +15 -0
- package/es/picker/math-module.js.map +1 -0
- package/es/picker/math-picker-service.d.ts +16 -0
- package/es/picker/math-picker-service.js +48 -0
- package/es/picker/math-picker-service.js.map +1 -0
- package/es/picker/module.d.ts +6 -0
- package/es/picker/module.js +28 -0
- package/es/picker/module.js.map +1 -0
- package/es/render/contributions/rough/config.js +1 -1
- package/es/render/contributions/rough/module.d.ts +1 -1
- package/es/render/contributions/rough/module.js +3 -5
- package/es/render/contributions/rough/module.js.map +1 -1
- package/es/render/contributions/rough/rough-arc.d.ts +1 -1
- package/es/render/contributions/rough/rough-arc.js +3 -4
- package/es/render/contributions/rough/rough-arc.js.map +1 -1
- package/es/render/contributions/rough/rough-area.d.ts +2 -2
- package/es/render/contributions/rough/rough-area.js +2 -4
- package/es/render/contributions/rough/rough-area.js.map +1 -1
- package/es/render/contributions/rough/rough-circle.d.ts +1 -1
- package/es/render/contributions/rough/rough-circle.js +2 -4
- package/es/render/contributions/rough/rough-circle.js.map +1 -1
- package/es/render/contributions/rough/rough-line.d.ts +2 -2
- package/es/render/contributions/rough/rough-line.js +2 -4
- package/es/render/contributions/rough/rough-line.js.map +1 -1
- package/es/render/contributions/rough/rough-path.d.ts +1 -1
- package/es/render/contributions/rough/rough-path.js +2 -4
- package/es/render/contributions/rough/rough-path.js.map +1 -1
- package/es/render/contributions/rough/rough-rect.d.ts +1 -1
- package/es/render/contributions/rough/rough-rect.js +2 -4
- package/es/render/contributions/rough/rough-rect.js.map +1 -1
- package/es/render/contributions/rough/rough-symbol.d.ts +2 -2
- package/es/render/contributions/rough/rough-symbol.js +2 -4
- package/es/render/contributions/rough/rough-symbol.js.map +1 -1
- package/es/window/contributions/browser-contribution.d.ts +49 -0
- package/es/window/contributions/browser-contribution.js +176 -0
- package/es/window/contributions/browser-contribution.js.map +1 -0
- package/es/window/contributions/feishu-contribution.d.ts +47 -0
- package/es/window/contributions/feishu-contribution.js +157 -0
- package/es/window/contributions/feishu-contribution.js.map +1 -0
- package/es/window/contributions/lynx-contribution.d.ts +47 -0
- package/es/window/contributions/lynx-contribution.js +157 -0
- package/es/window/contributions/lynx-contribution.js.map +1 -0
- package/es/window/contributions/native-contribution.js +1 -0
- package/es/window/contributions/native-contribution.js.map +1 -0
- package/es/window/contributions/node-contribution.d.ts +40 -1
- package/es/window/contributions/node-contribution.js +109 -1
- package/es/window/contributions/node-contribution.js.map +1 -1
- package/es/window/contributions/taro-contribution.d.ts +47 -0
- package/es/window/contributions/taro-contribution.js +164 -0
- package/es/window/contributions/taro-contribution.js.map +1 -0
- package/es/window/contributions/wx-contribution.d.ts +47 -0
- package/es/window/contributions/wx-contribution.js +159 -0
- package/es/window/contributions/wx-contribution.js.map +1 -0
- package/package.json +3 -5
- package/cjs/canvas/contributions/canvas-module.js +0 -1
- package/cjs/canvas/contributions/canvas-module.js.map +0 -1
- package/cjs/window/contributions/modules.js +0 -1
- package/cjs/window/contributions/modules.js.map +0 -1
- package/es/canvas/contributions/canvas-module.d.ts +0 -1
- package/es/canvas/contributions/canvas-module.js +0 -1
- package/es/canvas/contributions/canvas-module.js.map +0 -1
- package/es/window/contributions/modules.d.ts +0 -1
- package/es/window/contributions/modules.js +0 -1
- package/es/window/contributions/modules.js.map +0 -1
- /package/cjs/{canvas/contributions/canvas-module.d.ts → window/contributions/native-contribution.d.ts} +0 -0
- /package/{cjs/window/contributions/modules.d.ts → es/window/contributions/native-contribution.d.ts} +0 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import type { IPointLike, TextMeasure, ITextMeasureSpec } from '@visactor/vutils';
|
|
2
|
+
import { Matrix } from '@visactor/vutils';
|
|
3
|
+
import type { ICamera, ICanvas, ICommonStyleParams, IConicalGradientData, IContext2d, ISetCommonStyleParams, ISetStrokeStyleParams, IStrokeStyleParams, ITextStyleParams, mat4, EnvType, vec3 } from '@visactor/vrender-core';
|
|
4
|
+
export declare class BrowserContext2d implements IContext2d {
|
|
5
|
+
static env: EnvType;
|
|
6
|
+
drawPromise?: Promise<any>;
|
|
7
|
+
mathTextMeasure: TextMeasure<ITextMeasureSpec>;
|
|
8
|
+
canvas: ICanvas;
|
|
9
|
+
camera?: ICamera;
|
|
10
|
+
modelMatrix?: mat4;
|
|
11
|
+
nativeContext: CanvasRenderingContext2D | any;
|
|
12
|
+
_inuse: boolean;
|
|
13
|
+
stack: Matrix[];
|
|
14
|
+
disableFill?: boolean;
|
|
15
|
+
disableStroke?: boolean;
|
|
16
|
+
disableBeginPath?: boolean;
|
|
17
|
+
protected matrix: Matrix;
|
|
18
|
+
protected applyedMatrix?: Matrix;
|
|
19
|
+
fontFamily: string;
|
|
20
|
+
fontSize: number;
|
|
21
|
+
set fillStyle(d: string | CanvasGradient | CanvasPattern);
|
|
22
|
+
get fillStyle(): string | CanvasGradient | CanvasPattern;
|
|
23
|
+
set font(d: string);
|
|
24
|
+
get font(): string;
|
|
25
|
+
set globalAlpha(d: number);
|
|
26
|
+
get globalAlpha(): number;
|
|
27
|
+
set lineCap(d: CanvasLineCap);
|
|
28
|
+
get lineCap(): CanvasLineCap;
|
|
29
|
+
set lineDashOffset(d: number);
|
|
30
|
+
get lineDashOffset(): number;
|
|
31
|
+
set lineJoin(d: CanvasLineJoin);
|
|
32
|
+
get lineJoin(): CanvasLineJoin;
|
|
33
|
+
set lineWidth(d: number);
|
|
34
|
+
get lineWidth(): number;
|
|
35
|
+
set miterLimit(d: number);
|
|
36
|
+
get miterLimit(): number;
|
|
37
|
+
set shadowBlur(d: number);
|
|
38
|
+
get shadowBlur(): number;
|
|
39
|
+
set shadowColor(d: string);
|
|
40
|
+
get shadowColor(): string;
|
|
41
|
+
set shadowOffsetX(d: number);
|
|
42
|
+
get shadowOffsetX(): number;
|
|
43
|
+
set shadowOffsetY(d: number);
|
|
44
|
+
get shadowOffsetY(): number;
|
|
45
|
+
set strokeStyle(d: string | CanvasGradient | CanvasPattern);
|
|
46
|
+
get strokeStyle(): string | CanvasGradient | CanvasPattern;
|
|
47
|
+
set textAlign(d: CanvasTextAlign);
|
|
48
|
+
get textAlign(): CanvasTextAlign;
|
|
49
|
+
set textBaseline(d: CanvasTextBaseline);
|
|
50
|
+
get textBaseline(): CanvasTextBaseline;
|
|
51
|
+
get inuse(): boolean;
|
|
52
|
+
set inuse(use: boolean);
|
|
53
|
+
dpr: number;
|
|
54
|
+
constructor(canvas: ICanvas, dpr: number);
|
|
55
|
+
reset(): void;
|
|
56
|
+
getCanvas(): ICanvas;
|
|
57
|
+
getContext(): any;
|
|
58
|
+
setTransformForCurrent(force?: boolean): void;
|
|
59
|
+
get currentMatrix(): Matrix;
|
|
60
|
+
cloneMatrix(m: Matrix): import("@visactor/vutils").IMatrix;
|
|
61
|
+
clear(): void;
|
|
62
|
+
restore(): void;
|
|
63
|
+
highPerformanceRestore(): void;
|
|
64
|
+
rotate(rad: number, setTransform?: boolean): void;
|
|
65
|
+
save(): void;
|
|
66
|
+
highPerformanceSave(): void;
|
|
67
|
+
scale(sx: number, sy: number, setTransform?: boolean): void;
|
|
68
|
+
setScale(sx: number, sy: number, setTransform?: boolean): void;
|
|
69
|
+
scalePoint(sx: number, sy: number, px: number, py: number, setTransform?: boolean): void;
|
|
70
|
+
setTransform(a: number, b: number, c: number, d: number, e: number, f: number, setTransform?: boolean, dpr?: number): void;
|
|
71
|
+
setTransformFromMatrix(matrix: Matrix, setTransform?: boolean, dpr?: number): void;
|
|
72
|
+
resetTransform(setTransform?: boolean, dpr?: number): void;
|
|
73
|
+
transform(a: number, b: number, c: number, d: number, e: number, f: number, setTransform?: boolean): void;
|
|
74
|
+
transformFromMatrix(matrix: Matrix, setTransform?: boolean): void;
|
|
75
|
+
translate(x: number, y: number, setTransform?: boolean): void;
|
|
76
|
+
rotateDegrees(deg: number, setTransform?: boolean): void;
|
|
77
|
+
rotateAbout(rad: number, x: number, y: number, setTransform?: boolean): void;
|
|
78
|
+
rotateDegreesAbout(deg: number, x: number, y: number, setTransform?: boolean): void;
|
|
79
|
+
beginPath(): void;
|
|
80
|
+
clip(fillRule?: CanvasFillRule): void;
|
|
81
|
+
clip(path: Path2D, fillRule?: CanvasFillRule): void;
|
|
82
|
+
arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean, z?: number): void;
|
|
83
|
+
arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void;
|
|
84
|
+
bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number, z?: number): void;
|
|
85
|
+
closePath(): void;
|
|
86
|
+
ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;
|
|
87
|
+
lineTo(x: number, y: number, z: number): void;
|
|
88
|
+
moveTo(x: number, y: number, z: number): void;
|
|
89
|
+
quadraticCurveTo(cpx: number, cpy: number, x: number, y: number, z: number): void;
|
|
90
|
+
rect(x: number, y: number, w: number, h: number, z: number): void;
|
|
91
|
+
createImageData(imageDataOrSw: number | ImageData, sh?: number): ImageData;
|
|
92
|
+
createLinearGradient(x0: number, y0: number, x1: number, y1: number): any;
|
|
93
|
+
createPattern(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, repetition: string): CanvasPattern;
|
|
94
|
+
createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient;
|
|
95
|
+
createConicGradient(x: number, y: number, startAngle: number, endAngle: number): IConicalGradientData;
|
|
96
|
+
fill(path?: Path2D, fillRule?: CanvasFillRule): void;
|
|
97
|
+
fillRect(x: number, y: number, width: number, height: number): void;
|
|
98
|
+
clearRect(x: number, y: number, w: number, h: number): void;
|
|
99
|
+
project(x: number, y: number, z: number): IPointLike;
|
|
100
|
+
view(x: number, y: number, z: number): vec3;
|
|
101
|
+
fillText(text: string, x: number, y: number, z: number): void;
|
|
102
|
+
getImageData(sx: number, sy: number, sw: number, sh: number): ImageData;
|
|
103
|
+
getLineDash(): number[];
|
|
104
|
+
isPointInPath(x: number, y: number): any;
|
|
105
|
+
isPointInStroke(x: number, y: number): any;
|
|
106
|
+
measureText(text: string, method?: 'native' | 'simple' | 'quick'): {
|
|
107
|
+
width: number;
|
|
108
|
+
};
|
|
109
|
+
putImageData(imagedata: ImageData, dx: number, dy: number): void;
|
|
110
|
+
setLineDash(segments: number[]): void;
|
|
111
|
+
stroke(path?: Path2D): void;
|
|
112
|
+
strokeRect(x: number, y: number, width: number, height: number): void;
|
|
113
|
+
strokeText(text: string, x: number, y: number, z: number): void;
|
|
114
|
+
drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap, dstX: number, dstY: number): void;
|
|
115
|
+
drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap, dstX: number, dstY: number, dstW: number, dstH: number): void;
|
|
116
|
+
drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap, srcX: number, srcY: number, srcW: number, srcH: number, dstX: number, dstY: number, dstW: number, dstH: number): void;
|
|
117
|
+
protected fillAttributes: {
|
|
118
|
+
opacity: number;
|
|
119
|
+
fillOpacity: number;
|
|
120
|
+
shadowBlur: number;
|
|
121
|
+
shadowColor: string;
|
|
122
|
+
shadowOffsetX: number;
|
|
123
|
+
shadowOffsetY: number;
|
|
124
|
+
fill: import("@visactor/vrender-core").IFillType;
|
|
125
|
+
};
|
|
126
|
+
protected strokeAttributes: {
|
|
127
|
+
opacity: number;
|
|
128
|
+
outerBorder: Partial<import("@visactor/vrender-core").IBorderStyle>;
|
|
129
|
+
innerBorder: Partial<import("@visactor/vrender-core").IBorderStyle>;
|
|
130
|
+
strokeOpacity: number;
|
|
131
|
+
lineDash: number[];
|
|
132
|
+
lineDashOffset: number;
|
|
133
|
+
lineWidth: number;
|
|
134
|
+
lineCap: CanvasLineCap;
|
|
135
|
+
lineJoin: CanvasLineJoin;
|
|
136
|
+
miterLimit: number;
|
|
137
|
+
strokeBoundsBuffer: number;
|
|
138
|
+
stroke: import("@visactor/vrender-core").IStrokeType | import("@visactor/vrender-core").IStrokeType[];
|
|
139
|
+
};
|
|
140
|
+
protected textAttributes: {
|
|
141
|
+
opacity: number;
|
|
142
|
+
text: string | number | number[] | string[];
|
|
143
|
+
maxLineWidth: number;
|
|
144
|
+
textAlign: import("@visactor/vrender-core").TextAlignType;
|
|
145
|
+
textBaseline: import("@visactor/vrender-core").TextBaselineType;
|
|
146
|
+
fontSize: number;
|
|
147
|
+
fontFamily: string;
|
|
148
|
+
fontWeight: string | number;
|
|
149
|
+
ellipsis: string | boolean;
|
|
150
|
+
fontVariant: string;
|
|
151
|
+
fontStyle: string;
|
|
152
|
+
lineHeight: number;
|
|
153
|
+
underline: number;
|
|
154
|
+
lineThrough: number;
|
|
155
|
+
scaleIn3d: boolean;
|
|
156
|
+
direction: "horizontal" | "vertical";
|
|
157
|
+
verticalMode: number;
|
|
158
|
+
wordBreak: "break-word" | "break-all";
|
|
159
|
+
ignoreBuf: boolean;
|
|
160
|
+
};
|
|
161
|
+
setCommonStyle(params: ISetCommonStyleParams, attribute: ICommonStyleParams, offsetX: number, offsetY: number, defaultParams?: ICommonStyleParams | Partial<ICommonStyleParams>[]): void;
|
|
162
|
+
protected _setCommonStyle(params: ISetCommonStyleParams, attribute: ICommonStyleParams, offsetX: number, offsetY: number, defaultParams?: ICommonStyleParams): void;
|
|
163
|
+
setShadowBlendStyle(params: ISetCommonStyleParams, attribute: ICommonStyleParams, defaultParams?: ICommonStyleParams | Partial<ICommonStyleParams>[]): void;
|
|
164
|
+
protected _clearShadowStyle: boolean;
|
|
165
|
+
protected _clearFilterStyle: boolean;
|
|
166
|
+
protected _clearGlobalCompositeOperationStyle: boolean;
|
|
167
|
+
protected _setShadowBlendStyle(params: ISetCommonStyleParams, attribute: ICommonStyleParams, defaultParams?: ICommonStyleParams): void;
|
|
168
|
+
setStrokeStyle(params: ISetStrokeStyleParams, attribute: IStrokeStyleParams, offsetX: number, offsetY: number, defaultParams?: IStrokeStyleParams | IStrokeStyleParams[]): void;
|
|
169
|
+
protected _setStrokeStyle(params: ISetStrokeStyleParams, attribute: IStrokeStyleParams, offsetX: number, offsetY: number, defaultParams?: IStrokeStyleParams): void;
|
|
170
|
+
setTextStyleWithoutAlignBaseline(params: Partial<ITextStyleParams>, defaultParams?: ITextStyleParams, z?: number): void;
|
|
171
|
+
setTextStyle(params: Partial<ITextStyleParams>, defaultParams?: ITextStyleParams, z?: number): void;
|
|
172
|
+
draw(): void;
|
|
173
|
+
clearMatrix(setTransform?: boolean, dpr?: number): void;
|
|
174
|
+
onlyTranslate(dpr?: number): boolean;
|
|
175
|
+
release(...params: any): void;
|
|
176
|
+
}
|
|
@@ -0,0 +1,490 @@
|
|
|
1
|
+
var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
|
|
2
|
+
var d, c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
3
|
+
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
|
|
4
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
5
|
+
}, __metadata = this && this.__metadata || function(k, v) {
|
|
6
|
+
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
import { Matrix, pi, pi2 } from "@visactor/vutils";
|
|
10
|
+
|
|
11
|
+
import { injectable, DefaultFillStyle, DefaultStrokeStyle, DefaultTextStyle, createColor, getScaledStroke, application, matrixAllocate, transformMat4, getContextFont, createConicalGradient } from "@visactor/vrender-core";
|
|
12
|
+
|
|
13
|
+
const outP = [ 0, 0, 0 ], initMatrix = new Matrix(1, 0, 0, 1, 0, 0), addArcToBezierPath = (bezierPath, startAngle, endAngle, cx, cy, rx, ry, clockwise) => {
|
|
14
|
+
if (clockwise) for (;endAngle > startAngle; ) endAngle -= pi2; else for (;endAngle < startAngle; ) endAngle += pi2;
|
|
15
|
+
const step = pi / 3 * (endAngle > startAngle ? 1 : -1);
|
|
16
|
+
let sa = startAngle, ea = sa;
|
|
17
|
+
for (;ea !== endAngle; ) {
|
|
18
|
+
ea = step > 0 ? Math.min(ea + step, endAngle) : Math.max(ea + step, endAngle);
|
|
19
|
+
const delta = Math.abs(ea - sa), len = 4 * Math.tan(delta / 4) / 3, dir = ea < sa ? -1 : 1, c1 = Math.cos(sa), s1 = Math.sin(sa), c2 = Math.cos(ea), s2 = Math.sin(ea), x1 = c1 * rx + cx, y1 = s1 * ry + cy, x4 = c2 * rx + cx, y4 = s2 * ry + cy, hx = rx * len * dir, hy = ry * len * dir;
|
|
20
|
+
bezierPath.push([ x1 - hx * s1, y1 + hy * c1, x4 + hx * s2, y4 - hy * c2, x4, y4 ]),
|
|
21
|
+
sa = ea;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
let BrowserContext2d = class {
|
|
26
|
+
set fillStyle(d) {
|
|
27
|
+
this.nativeContext.fillStyle = d;
|
|
28
|
+
}
|
|
29
|
+
get fillStyle() {
|
|
30
|
+
return this.nativeContext.fillStyle;
|
|
31
|
+
}
|
|
32
|
+
set font(d) {
|
|
33
|
+
this.nativeContext.font = d;
|
|
34
|
+
}
|
|
35
|
+
get font() {
|
|
36
|
+
return this.nativeContext.font;
|
|
37
|
+
}
|
|
38
|
+
set globalAlpha(d) {
|
|
39
|
+
this.nativeContext.globalAlpha = d;
|
|
40
|
+
}
|
|
41
|
+
get globalAlpha() {
|
|
42
|
+
return this.nativeContext.globalAlpha;
|
|
43
|
+
}
|
|
44
|
+
set lineCap(d) {
|
|
45
|
+
this.nativeContext.lineCap = d;
|
|
46
|
+
}
|
|
47
|
+
get lineCap() {
|
|
48
|
+
return this.nativeContext.lineCap;
|
|
49
|
+
}
|
|
50
|
+
set lineDashOffset(d) {
|
|
51
|
+
this.nativeContext.lineDashOffset = d;
|
|
52
|
+
}
|
|
53
|
+
get lineDashOffset() {
|
|
54
|
+
return this.nativeContext.lineDashOffset;
|
|
55
|
+
}
|
|
56
|
+
set lineJoin(d) {
|
|
57
|
+
this.nativeContext.lineJoin = d;
|
|
58
|
+
}
|
|
59
|
+
get lineJoin() {
|
|
60
|
+
return this.nativeContext.lineJoin;
|
|
61
|
+
}
|
|
62
|
+
set lineWidth(d) {
|
|
63
|
+
this.nativeContext.lineWidth = d;
|
|
64
|
+
}
|
|
65
|
+
get lineWidth() {
|
|
66
|
+
return this.nativeContext.lineWidth;
|
|
67
|
+
}
|
|
68
|
+
set miterLimit(d) {
|
|
69
|
+
this.nativeContext.miterLimit = d;
|
|
70
|
+
}
|
|
71
|
+
get miterLimit() {
|
|
72
|
+
return this.nativeContext.miterLimit;
|
|
73
|
+
}
|
|
74
|
+
set shadowBlur(d) {
|
|
75
|
+
this.nativeContext.shadowBlur = d;
|
|
76
|
+
}
|
|
77
|
+
get shadowBlur() {
|
|
78
|
+
return this.nativeContext.shadowBlur;
|
|
79
|
+
}
|
|
80
|
+
set shadowColor(d) {
|
|
81
|
+
this.nativeContext.shadowColor = d;
|
|
82
|
+
}
|
|
83
|
+
get shadowColor() {
|
|
84
|
+
return this.nativeContext.shadowColor;
|
|
85
|
+
}
|
|
86
|
+
set shadowOffsetX(d) {
|
|
87
|
+
this.nativeContext.shadowOffsetX = d;
|
|
88
|
+
}
|
|
89
|
+
get shadowOffsetX() {
|
|
90
|
+
return this.nativeContext.shadowOffsetX;
|
|
91
|
+
}
|
|
92
|
+
set shadowOffsetY(d) {
|
|
93
|
+
this.nativeContext.shadowOffsetY = d;
|
|
94
|
+
}
|
|
95
|
+
get shadowOffsetY() {
|
|
96
|
+
return this.nativeContext.shadowOffsetY;
|
|
97
|
+
}
|
|
98
|
+
set strokeStyle(d) {
|
|
99
|
+
this.nativeContext.strokeStyle = d;
|
|
100
|
+
}
|
|
101
|
+
get strokeStyle() {
|
|
102
|
+
return this.nativeContext.strokeStyle;
|
|
103
|
+
}
|
|
104
|
+
set textAlign(d) {
|
|
105
|
+
this.nativeContext.textAlign = d;
|
|
106
|
+
}
|
|
107
|
+
get textAlign() {
|
|
108
|
+
return this.nativeContext.textAlign;
|
|
109
|
+
}
|
|
110
|
+
set textBaseline(d) {
|
|
111
|
+
this.nativeContext.textBaseline = d;
|
|
112
|
+
}
|
|
113
|
+
get textBaseline() {
|
|
114
|
+
return this.nativeContext.textBaseline;
|
|
115
|
+
}
|
|
116
|
+
get inuse() {
|
|
117
|
+
return !!this._inuse;
|
|
118
|
+
}
|
|
119
|
+
set inuse(use) {
|
|
120
|
+
use !== !!this._inuse && (this._inuse = use, use ? (this.nativeContext.save(), this.reset()) : this.nativeContext.restore());
|
|
121
|
+
}
|
|
122
|
+
constructor(canvas, dpr) {
|
|
123
|
+
this.fillAttributes = Object.assign(Object.assign({}, DefaultFillStyle), {
|
|
124
|
+
opacity: 1
|
|
125
|
+
}), this.strokeAttributes = Object.assign(Object.assign({}, DefaultStrokeStyle), {
|
|
126
|
+
opacity: 1
|
|
127
|
+
}), this.textAttributes = Object.assign(Object.assign({}, DefaultTextStyle), {
|
|
128
|
+
opacity: 1
|
|
129
|
+
}), this._clearShadowStyle = !1, this._clearFilterStyle = !1, this._clearGlobalCompositeOperationStyle = !1;
|
|
130
|
+
const context = canvas.nativeCanvas.getContext("2d");
|
|
131
|
+
if (!context) throw new Error("发生错误,获取2d上下文失败");
|
|
132
|
+
this.nativeContext = context, this.canvas = canvas, this.matrix = new Matrix(1, 0, 0, 1, 0, 0),
|
|
133
|
+
this.stack = [], this.dpr = dpr, this.applyedMatrix = new Matrix(1, 0, 0, 1, 0, 0);
|
|
134
|
+
}
|
|
135
|
+
reset() {
|
|
136
|
+
this.stack.length && console.warn("可能存在bug,matrix没有清空"), this.matrix.setValue(1, 0, 0, 1, 0, 0),
|
|
137
|
+
this.applyedMatrix = new Matrix(1, 0, 0, 1, 0, 0), this.stack.length = 0, this.nativeContext.setTransform(1, 0, 0, 1, 0, 0);
|
|
138
|
+
}
|
|
139
|
+
getCanvas() {
|
|
140
|
+
return this.canvas;
|
|
141
|
+
}
|
|
142
|
+
getContext() {
|
|
143
|
+
return this.nativeContext;
|
|
144
|
+
}
|
|
145
|
+
setTransformForCurrent(force = !1) {
|
|
146
|
+
!force && this.applyedMatrix.equalToMatrix(this.matrix) || (this.applyedMatrix.setValue(this.matrix.a, this.matrix.b, this.matrix.c, this.matrix.d, this.matrix.e, this.matrix.f),
|
|
147
|
+
this.nativeContext.setTransform(this.matrix.a, this.matrix.b, this.matrix.c, this.matrix.d, this.matrix.e, this.matrix.f));
|
|
148
|
+
}
|
|
149
|
+
get currentMatrix() {
|
|
150
|
+
return this.matrix;
|
|
151
|
+
}
|
|
152
|
+
cloneMatrix(m) {
|
|
153
|
+
return matrixAllocate.allocateByObj(m);
|
|
154
|
+
}
|
|
155
|
+
clear() {
|
|
156
|
+
this.save(), this.resetTransform(), this.nativeContext.clearRect(0, 0, this.canvas.width, this.canvas.height),
|
|
157
|
+
this.restore();
|
|
158
|
+
}
|
|
159
|
+
restore() {
|
|
160
|
+
this.nativeContext.restore(), this.stack.length > 0 && (matrixAllocate.free(this.matrix),
|
|
161
|
+
this.matrix = this.stack.pop(), this.setTransformForCurrent(!0));
|
|
162
|
+
}
|
|
163
|
+
highPerformanceRestore() {
|
|
164
|
+
this.stack.length > 0 && (matrixAllocate.free(this.matrix), this.matrix = this.stack.pop());
|
|
165
|
+
}
|
|
166
|
+
rotate(rad, setTransform = !0) {
|
|
167
|
+
this.matrix.rotate(rad), setTransform && this.setTransformForCurrent();
|
|
168
|
+
}
|
|
169
|
+
save() {
|
|
170
|
+
const matrix = this.cloneMatrix(this.matrix);
|
|
171
|
+
this.stack.push(matrix), this.nativeContext.save();
|
|
172
|
+
}
|
|
173
|
+
highPerformanceSave() {
|
|
174
|
+
const matrix = this.cloneMatrix(this.matrix);
|
|
175
|
+
this.stack.push(matrix);
|
|
176
|
+
}
|
|
177
|
+
scale(sx, sy, setTransform = !0) {
|
|
178
|
+
this.matrix.scale(sx, sy), setTransform && this.setTransformForCurrent();
|
|
179
|
+
}
|
|
180
|
+
setScale(sx, sy, setTransform = !0) {
|
|
181
|
+
this.matrix.setScale(sx, sy), setTransform && this.setTransformForCurrent();
|
|
182
|
+
}
|
|
183
|
+
scalePoint(sx, sy, px, py, setTransform = !0) {
|
|
184
|
+
this.translate(px, py, !1), this.scale(sx, sy, !1), this.translate(-px, -py, !1),
|
|
185
|
+
setTransform && this.setTransformForCurrent();
|
|
186
|
+
}
|
|
187
|
+
setTransform(a, b, c, d, e, f, setTransform = !0, dpr = this.dpr) {
|
|
188
|
+
this.matrix.setValue(dpr * a, dpr * b, dpr * c, dpr * d, dpr * e, dpr * f), setTransform && this.setTransformForCurrent();
|
|
189
|
+
}
|
|
190
|
+
setTransformFromMatrix(matrix, setTransform = !0, dpr = this.dpr) {
|
|
191
|
+
this.matrix.setValue(matrix.a * dpr, matrix.b * dpr, matrix.c * dpr, matrix.d * dpr, matrix.e * dpr, matrix.f * dpr),
|
|
192
|
+
setTransform && this.setTransformForCurrent();
|
|
193
|
+
}
|
|
194
|
+
resetTransform(setTransform = !0, dpr = this.dpr) {
|
|
195
|
+
this.setTransform(dpr, 0, 0, dpr, 0, 0), setTransform && this.setTransformForCurrent();
|
|
196
|
+
}
|
|
197
|
+
transform(a, b, c, d, e, f, setTransform = !0) {
|
|
198
|
+
this.matrix.multiply(a, b, c, d, e, f), setTransform && this.setTransformForCurrent();
|
|
199
|
+
}
|
|
200
|
+
transformFromMatrix(matrix, setTransform) {
|
|
201
|
+
this.matrix.multiply(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f),
|
|
202
|
+
setTransform && this.setTransformForCurrent();
|
|
203
|
+
}
|
|
204
|
+
translate(x, y, setTransform = !0) {
|
|
205
|
+
this.matrix.translate(x, y), setTransform && this.setTransformForCurrent();
|
|
206
|
+
}
|
|
207
|
+
rotateDegrees(deg, setTransform = !0) {
|
|
208
|
+
const rad = deg * Math.PI / 180;
|
|
209
|
+
this.rotate(rad, setTransform);
|
|
210
|
+
}
|
|
211
|
+
rotateAbout(rad, x, y, setTransform = !0) {
|
|
212
|
+
this.translate(x, y, !1), this.rotate(rad, !1), this.translate(-x, -y, !1), setTransform && this.setTransformForCurrent();
|
|
213
|
+
}
|
|
214
|
+
rotateDegreesAbout(deg, x, y, setTransform = !0) {
|
|
215
|
+
this.translate(x, y, !1), this.rotateDegrees(deg, !1), this.translate(-x, -y, !1),
|
|
216
|
+
setTransform && this.setTransformForCurrent();
|
|
217
|
+
}
|
|
218
|
+
beginPath() {
|
|
219
|
+
this.disableBeginPath || this.nativeContext.beginPath();
|
|
220
|
+
}
|
|
221
|
+
clip(path, fillRule) {
|
|
222
|
+
path ? "string" == typeof path ? this.nativeContext.clip(path) : this.nativeContext.clip(path, fillRule) : this.nativeContext.clip();
|
|
223
|
+
}
|
|
224
|
+
arc(x, y, radius, startAngle, endAngle, anticlockwise, z) {
|
|
225
|
+
if (z = z || 0, this.camera) {
|
|
226
|
+
const arr = [];
|
|
227
|
+
addArcToBezierPath(arr, startAngle, endAngle, x, y, radius, radius, anticlockwise);
|
|
228
|
+
for (let i = 0; i < arr.length; ++i) {
|
|
229
|
+
const bez = arr[i];
|
|
230
|
+
this.bezierCurveTo(bez[0], bez[1], bez[2], bez[3], bez[4], bez[5], z);
|
|
231
|
+
}
|
|
232
|
+
} else this.nativeContext.arc(x, y, radius, startAngle, endAngle, anticlockwise);
|
|
233
|
+
}
|
|
234
|
+
arcTo(x1, y1, x2, y2, radiusX) {
|
|
235
|
+
this.nativeContext.arcTo(x1, y1, x2, y2, radiusX);
|
|
236
|
+
}
|
|
237
|
+
bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y, z) {
|
|
238
|
+
if (z = z || 0, this.camera) {
|
|
239
|
+
let cp1z = z, cp2z = z;
|
|
240
|
+
this.modelMatrix && (transformMat4(outP, [ cp1x, cp1y, z ], this.modelMatrix), cp1x = outP[0],
|
|
241
|
+
cp1y = outP[1], cp1z = outP[2], transformMat4(outP, [ cp2x, cp2y, z ], this.modelMatrix),
|
|
242
|
+
cp2x = outP[0], cp2y = outP[1], cp2z = outP[2], transformMat4(outP, [ x, y, z ], this.modelMatrix),
|
|
243
|
+
x = outP[0], y = outP[1], z = outP[2]);
|
|
244
|
+
let data = this.camera.vp(x, y, z);
|
|
245
|
+
x = data.x, y = data.y, data = this.camera.vp(cp1x, cp1y, cp1z), cp1x = data.x,
|
|
246
|
+
cp1y = data.y, data = this.camera.vp(cp2x, cp2y, cp2z), cp2x = data.x, cp2y = data.y;
|
|
247
|
+
}
|
|
248
|
+
this.nativeContext.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);
|
|
249
|
+
}
|
|
250
|
+
closePath() {
|
|
251
|
+
this.nativeContext.closePath();
|
|
252
|
+
}
|
|
253
|
+
ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise) {
|
|
254
|
+
null == anticlockwise ? this.nativeContext.ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle) : this.nativeContext.ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
|
|
255
|
+
}
|
|
256
|
+
lineTo(x, y, z) {
|
|
257
|
+
if (z = z || 0, this.camera) {
|
|
258
|
+
this.modelMatrix && (transformMat4(outP, [ x, y, z ], this.modelMatrix), x = outP[0],
|
|
259
|
+
y = outP[1], z = outP[2]);
|
|
260
|
+
const data = this.camera.vp(x, y, z);
|
|
261
|
+
x = data.x, y = data.y;
|
|
262
|
+
}
|
|
263
|
+
this.nativeContext.lineTo(x, y);
|
|
264
|
+
}
|
|
265
|
+
moveTo(x, y, z) {
|
|
266
|
+
if (z = z || 0, this.camera) {
|
|
267
|
+
this.modelMatrix && (transformMat4(outP, [ x, y, z ], this.modelMatrix), x = outP[0],
|
|
268
|
+
y = outP[1], z = outP[2]);
|
|
269
|
+
const data = this.camera.vp(x, y, z);
|
|
270
|
+
x = data.x, y = data.y;
|
|
271
|
+
}
|
|
272
|
+
this.nativeContext.moveTo(x, y);
|
|
273
|
+
}
|
|
274
|
+
quadraticCurveTo(cpx, cpy, x, y, z) {
|
|
275
|
+
if (z = z || 0, this.camera) {
|
|
276
|
+
let cpz = z;
|
|
277
|
+
this.modelMatrix && (transformMat4(outP, [ cpx, cpy, z ], this.modelMatrix), cpx = outP[0],
|
|
278
|
+
cpy = outP[1], cpz = outP[2], transformMat4(outP, [ x, y, z ], this.modelMatrix),
|
|
279
|
+
x = outP[0], y = outP[1], z = outP[2]);
|
|
280
|
+
let data = this.camera.vp(x, y, z);
|
|
281
|
+
x = data.x, y = data.y, data = this.camera.vp(cpx, cpy, cpz), cpx = data.x, cpy = data.y;
|
|
282
|
+
}
|
|
283
|
+
this.nativeContext.quadraticCurveTo(cpx, cpy, x, y);
|
|
284
|
+
}
|
|
285
|
+
rect(x, y, w, h, z) {
|
|
286
|
+
z = z || 0, this.camera ? (this.moveTo(x, y, z), this.lineTo(x + w, y, z), this.lineTo(x + w, y + h, z),
|
|
287
|
+
this.lineTo(x, y + h, z), this.closePath()) : this.nativeContext.rect(x, y, w, h);
|
|
288
|
+
}
|
|
289
|
+
createImageData() {
|
|
290
|
+
const a = arguments;
|
|
291
|
+
return 2 === a.length ? this.nativeContext.createImageData(a[0], a[1]) : 1 === a.length ? this.nativeContext.createImageData(a[0]) : null;
|
|
292
|
+
}
|
|
293
|
+
createLinearGradient(x0, y0, x1, y1) {
|
|
294
|
+
return this.nativeContext.createLinearGradient(x0, y0, x1, y1);
|
|
295
|
+
}
|
|
296
|
+
createPattern(image, repetition) {
|
|
297
|
+
return 0 === image.width || 0 === image.height ? null : this.nativeContext.createPattern(image, repetition);
|
|
298
|
+
}
|
|
299
|
+
createRadialGradient(x0, y0, r0, x1, y1, r1) {
|
|
300
|
+
return this.nativeContext.createRadialGradient(x0, y0, r0, x1, y1, r1);
|
|
301
|
+
}
|
|
302
|
+
createConicGradient(x, y, startAngle, endAngle) {
|
|
303
|
+
let pattern, edit = !1;
|
|
304
|
+
const ctx = this;
|
|
305
|
+
return {
|
|
306
|
+
stops: [],
|
|
307
|
+
addColorStop(offset, color) {
|
|
308
|
+
this.stops.push([ offset, color ]), edit = !0;
|
|
309
|
+
},
|
|
310
|
+
GetPattern(minW, minH, deltaAngle) {
|
|
311
|
+
return edit && (deltaAngle || (deltaAngle = endAngle - startAngle), pattern = createConicalGradient(ctx, this.stops, x, y, deltaAngle, startAngle, endAngle, minW, minH),
|
|
312
|
+
edit = !1), pattern;
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
fill(path, fillRule) {
|
|
317
|
+
this.disableFill || (path ? this.nativeContext.fill(path) : this.nativeContext.fill());
|
|
318
|
+
}
|
|
319
|
+
fillRect(x, y, width, height) {
|
|
320
|
+
this.nativeContext.fillRect(x, y, width, height);
|
|
321
|
+
}
|
|
322
|
+
clearRect(x, y, w, h) {
|
|
323
|
+
this.nativeContext.clearRect(x, y, w, h);
|
|
324
|
+
}
|
|
325
|
+
project(x, y, z) {
|
|
326
|
+
if (z = z || 0, this.camera) {
|
|
327
|
+
this.modelMatrix && (transformMat4(outP, [ x, y, z ], this.modelMatrix), x = outP[0],
|
|
328
|
+
y = outP[1], z = outP[2]);
|
|
329
|
+
const data = this.camera.vp(x, y, z);
|
|
330
|
+
x = data.x, y = data.y;
|
|
331
|
+
}
|
|
332
|
+
return {
|
|
333
|
+
x: x,
|
|
334
|
+
y: y
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
view(x, y, z) {
|
|
338
|
+
return z = z || 0, this.camera ? (this.modelMatrix && (transformMat4(outP, [ x, y, z ], this.modelMatrix),
|
|
339
|
+
x = outP[0], y = outP[1], z = outP[2]), this.camera.view(x, y, z)) : [ x, y, z ];
|
|
340
|
+
}
|
|
341
|
+
fillText(text, x, y, z) {
|
|
342
|
+
if (z = z || 0, this.camera) {
|
|
343
|
+
this.modelMatrix && (transformMat4(outP, [ x, y, z ], this.modelMatrix), x = outP[0],
|
|
344
|
+
y = outP[1], z = outP[2]);
|
|
345
|
+
const data = this.camera.vp(x, y, z);
|
|
346
|
+
x = data.x, y = data.y;
|
|
347
|
+
}
|
|
348
|
+
this.nativeContext.fillText(text, x, y);
|
|
349
|
+
}
|
|
350
|
+
getImageData(sx, sy, sw, sh) {
|
|
351
|
+
return this.nativeContext.getImageData(sx, sy, sw, sh);
|
|
352
|
+
}
|
|
353
|
+
getLineDash() {
|
|
354
|
+
return this.nativeContext.getLineDash();
|
|
355
|
+
}
|
|
356
|
+
isPointInPath(x, y) {
|
|
357
|
+
return this.nativeContext.isPointInPath(x, y);
|
|
358
|
+
}
|
|
359
|
+
isPointInStroke(x, y) {
|
|
360
|
+
return this.nativeContext.isPointInStroke(x, y);
|
|
361
|
+
}
|
|
362
|
+
measureText(text, method = application.global.measureTextMethod) {
|
|
363
|
+
var _a, _b;
|
|
364
|
+
return method && "native" !== method ? (this.mathTextMeasure || (this.mathTextMeasure = application.graphicUtil.createTextMeasureInstance({}, {}, (() => this.canvas))),
|
|
365
|
+
this.mathTextMeasure.textSpec.fontFamily = null !== (_a = this.fontFamily) && void 0 !== _a ? _a : DefaultTextStyle.fontFamily,
|
|
366
|
+
this.mathTextMeasure.textSpec.fontSize = null !== (_b = this.fontSize) && void 0 !== _b ? _b : DefaultTextStyle.fontSize,
|
|
367
|
+
this.mathTextMeasure._numberCharSize = null, this.mathTextMeasure._fullCharSize = null,
|
|
368
|
+
this.mathTextMeasure._letterCharSize = null, this.mathTextMeasure._specialCharSizeMap = {},
|
|
369
|
+
this.mathTextMeasure.measure(text, method)) : this.nativeContext.measureText(text);
|
|
370
|
+
}
|
|
371
|
+
putImageData(imagedata, dx, dy) {
|
|
372
|
+
this.nativeContext.putImageData(imagedata, dx, dy);
|
|
373
|
+
}
|
|
374
|
+
setLineDash(segments) {
|
|
375
|
+
const a = arguments, _context = this.nativeContext;
|
|
376
|
+
this.nativeContext.setLineDash ? _context.setLineDash(a[0]) : "mozDash" in _context ? _context.mozDash = a[0] : "webkitLineDash" in _context && (_context.webkitLineDash = a[0]);
|
|
377
|
+
}
|
|
378
|
+
stroke(path) {
|
|
379
|
+
this.disableStroke || (path ? this.nativeContext.stroke(path) : this.nativeContext.stroke());
|
|
380
|
+
}
|
|
381
|
+
strokeRect(x, y, width, height) {
|
|
382
|
+
this.nativeContext.strokeRect(x, y, width, height);
|
|
383
|
+
}
|
|
384
|
+
strokeText(text, x, y, z) {
|
|
385
|
+
if (z = z || 0, this.camera) {
|
|
386
|
+
this.modelMatrix && (transformMat4(outP, [ x, y, z ], this.modelMatrix), x = outP[0],
|
|
387
|
+
y = outP[1], z = outP[2]);
|
|
388
|
+
const data = this.camera.vp(x, y, z);
|
|
389
|
+
x = data.x, y = data.y;
|
|
390
|
+
}
|
|
391
|
+
this.nativeContext.strokeText(text, x, y);
|
|
392
|
+
}
|
|
393
|
+
drawImage() {
|
|
394
|
+
const _context = this.nativeContext, a = arguments;
|
|
395
|
+
3 === a.length ? _context.drawImage(a[0], a[1], a[2]) : 5 === a.length ? _context.drawImage(a[0], a[1], a[2], a[3], a[4]) : 9 === a.length && _context.drawImage(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]);
|
|
396
|
+
}
|
|
397
|
+
setCommonStyle(params, attribute, offsetX, offsetY, defaultParams) {
|
|
398
|
+
if (Array.isArray(defaultParams)) {
|
|
399
|
+
if (defaultParams.length <= 1) return this._setCommonStyle(params, attribute, offsetX, offsetY, defaultParams[0]);
|
|
400
|
+
const dp = {};
|
|
401
|
+
return defaultParams.forEach((p => {
|
|
402
|
+
Object.assign(dp, p);
|
|
403
|
+
})), this._setCommonStyle(params, attribute, offsetX, offsetY, dp);
|
|
404
|
+
}
|
|
405
|
+
return this._setCommonStyle(params, attribute, offsetX, offsetY, defaultParams);
|
|
406
|
+
}
|
|
407
|
+
_setCommonStyle(params, attribute, offsetX, offsetY, defaultParams) {
|
|
408
|
+
const _context = this.nativeContext;
|
|
409
|
+
defaultParams || (defaultParams = this.fillAttributes);
|
|
410
|
+
const {fillOpacity: fillOpacity = defaultParams.fillOpacity, opacity: opacity = defaultParams.opacity, fill: fill = defaultParams.fill} = attribute;
|
|
411
|
+
fillOpacity > 1e-12 && opacity > 1e-12 ? (_context.globalAlpha = fillOpacity * opacity,
|
|
412
|
+
_context.fillStyle = createColor(this, fill, params, offsetX, offsetY)) : _context.globalAlpha = fillOpacity * opacity;
|
|
413
|
+
}
|
|
414
|
+
setShadowBlendStyle(params, attribute, defaultParams) {
|
|
415
|
+
if (Array.isArray(defaultParams)) {
|
|
416
|
+
if (defaultParams.length <= 1) return this._setShadowBlendStyle(params, defaultParams[0]);
|
|
417
|
+
const dp = {};
|
|
418
|
+
return defaultParams.forEach((p => {
|
|
419
|
+
Object.assign(dp, p);
|
|
420
|
+
})), this._setShadowBlendStyle(params, attribute, dp);
|
|
421
|
+
}
|
|
422
|
+
return this._setShadowBlendStyle(params, attribute, defaultParams);
|
|
423
|
+
}
|
|
424
|
+
_setShadowBlendStyle(params, attribute, defaultParams) {
|
|
425
|
+
const _context = this.nativeContext;
|
|
426
|
+
defaultParams || (defaultParams = this.fillAttributes);
|
|
427
|
+
const {opacity: opacity = defaultParams.opacity, shadowBlur: shadowBlur = defaultParams.shadowBlur, shadowColor: shadowColor = defaultParams.shadowColor, shadowOffsetX: shadowOffsetX = defaultParams.shadowOffsetX, shadowOffsetY: shadowOffsetY = defaultParams.shadowOffsetY, blur: blur = defaultParams.blur, globalCompositeOperation: globalCompositeOperation = defaultParams.globalCompositeOperation} = attribute;
|
|
428
|
+
opacity <= 1e-12 || (shadowBlur || shadowOffsetX || shadowOffsetY ? (_context.shadowBlur = shadowBlur,
|
|
429
|
+
_context.shadowColor = shadowColor, _context.shadowOffsetX = shadowOffsetX, _context.shadowOffsetY = shadowOffsetY,
|
|
430
|
+
this._clearShadowStyle = !0) : this._clearShadowStyle && (_context.shadowBlur = 0,
|
|
431
|
+
_context.shadowOffsetX = 0, _context.shadowOffsetY = 0), blur ? (_context.filter = `blur(${blur}px)`,
|
|
432
|
+
this._clearFilterStyle = !0) : this._clearFilterStyle && (_context.filter = "blur(0px)",
|
|
433
|
+
this._clearFilterStyle = !1), globalCompositeOperation ? (_context.globalCompositeOperation = globalCompositeOperation,
|
|
434
|
+
this._clearGlobalCompositeOperationStyle = !0) : this._clearGlobalCompositeOperationStyle && (_context.globalCompositeOperation = "source-over",
|
|
435
|
+
this._clearGlobalCompositeOperationStyle = !1));
|
|
436
|
+
}
|
|
437
|
+
setStrokeStyle(params, attribute, offsetX, offsetY, defaultParams) {
|
|
438
|
+
if (Array.isArray(defaultParams)) {
|
|
439
|
+
if (defaultParams.length <= 1) return this._setStrokeStyle(params, attribute, offsetX, offsetY, defaultParams[0]);
|
|
440
|
+
const dp = {};
|
|
441
|
+
return defaultParams.forEach((p => {
|
|
442
|
+
Object.assign(dp, p);
|
|
443
|
+
})), this._setStrokeStyle(params, attribute, offsetX, offsetY, dp);
|
|
444
|
+
}
|
|
445
|
+
return this._setStrokeStyle(params, attribute, offsetX, offsetY, defaultParams);
|
|
446
|
+
}
|
|
447
|
+
_setStrokeStyle(params, attribute, offsetX, offsetY, defaultParams) {
|
|
448
|
+
const _context = this.nativeContext;
|
|
449
|
+
defaultParams || (defaultParams = this.strokeAttributes);
|
|
450
|
+
const {strokeOpacity: strokeOpacity = defaultParams.strokeOpacity, opacity: opacity = defaultParams.opacity} = attribute;
|
|
451
|
+
if (strokeOpacity > 1e-12 && opacity > 1e-12) {
|
|
452
|
+
const {lineWidth: lineWidth = defaultParams.lineWidth, stroke: stroke = defaultParams.stroke, lineJoin: lineJoin = defaultParams.lineJoin, lineDash: lineDash = defaultParams.lineDash, lineCap: lineCap = defaultParams.lineCap, miterLimit: miterLimit = defaultParams.miterLimit} = attribute;
|
|
453
|
+
_context.globalAlpha = strokeOpacity * opacity, _context.lineWidth = getScaledStroke(this, lineWidth, this.dpr),
|
|
454
|
+
_context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin,
|
|
455
|
+
_context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
setTextStyleWithoutAlignBaseline(params, defaultParams, z) {
|
|
459
|
+
const _context = this.nativeContext;
|
|
460
|
+
defaultParams || (defaultParams = this.textAttributes);
|
|
461
|
+
const {scaleIn3d: scaleIn3d = defaultParams.scaleIn3d} = params;
|
|
462
|
+
params.font ? _context.font = params.font : _context.font = getContextFont(params, defaultParams, scaleIn3d && this.camera && this.camera.getProjectionScale(z));
|
|
463
|
+
const {fontFamily: fontFamily = defaultParams.fontFamily, fontSize: fontSize = defaultParams.fontSize} = params;
|
|
464
|
+
this.fontFamily = fontFamily, this.fontSize = fontSize, _context.textAlign = "left",
|
|
465
|
+
_context.textBaseline = "alphabetic";
|
|
466
|
+
}
|
|
467
|
+
setTextStyle(params, defaultParams, z) {
|
|
468
|
+
var _a, _b;
|
|
469
|
+
const _context = this.nativeContext;
|
|
470
|
+
defaultParams || (defaultParams = this.textAttributes), params.font ? _context.font = params.font : _context.font = getContextFont(params, defaultParams, this.camera && this.camera.getProjectionScale(z));
|
|
471
|
+
const {fontFamily: fontFamily = defaultParams.fontFamily, fontSize: fontSize = defaultParams.fontSize} = params;
|
|
472
|
+
this.fontFamily = fontFamily, this.fontSize = fontSize, _context.textAlign = null !== (_a = params.textAlign) && void 0 !== _a ? _a : defaultParams.textAlign,
|
|
473
|
+
_context.textBaseline = null !== (_b = params.textBaseline) && void 0 !== _b ? _b : defaultParams.textBaseline;
|
|
474
|
+
}
|
|
475
|
+
draw() {}
|
|
476
|
+
clearMatrix(setTransform = !0, dpr = this.dpr) {
|
|
477
|
+
this.setTransformFromMatrix(initMatrix, setTransform, dpr);
|
|
478
|
+
}
|
|
479
|
+
onlyTranslate(dpr = this.dpr) {
|
|
480
|
+
return this.matrix.a === dpr && 0 === this.matrix.b && 0 === this.matrix.c && this.matrix.d === dpr;
|
|
481
|
+
}
|
|
482
|
+
release(...params) {
|
|
483
|
+
this.stack.forEach((m => matrixAllocate.free(m))), this.stack.length = 0;
|
|
484
|
+
}
|
|
485
|
+
};
|
|
486
|
+
|
|
487
|
+
BrowserContext2d.env = "browser", BrowserContext2d = __decorate([ injectable(), __metadata("design:paramtypes", [ Object, Number ]) ], BrowserContext2d);
|
|
488
|
+
|
|
489
|
+
export { BrowserContext2d };
|
|
490
|
+
//# sourceMappingURL=context.js.map
|