@visactor/vrender-core 0.22.8 → 0.22.9-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/common/contribution-provider.d.ts +16 -0
- package/cjs/common/contribution-provider.js +21 -2
- package/cjs/common/contribution-provider.js.map +1 -1
- package/cjs/common/event-listener-manager.d.ts +14 -0
- package/cjs/common/event-listener-manager.js +52 -0
- package/cjs/common/event-listener-manager.js.map +1 -0
- package/cjs/common/event-transformer.d.ts +12 -0
- package/cjs/common/event-transformer.js +73 -0
- package/cjs/common/event-transformer.js.map +1 -0
- package/cjs/common/polygon.js +0 -1
- package/cjs/common/render-area.js +1 -0
- package/cjs/common/sort.js +1 -1
- package/cjs/common/split-path.js +1 -1
- package/cjs/core/global.d.ts +7 -5
- package/cjs/core/global.js +13 -13
- package/cjs/core/global.js.map +1 -1
- package/cjs/core/stage.d.ts +1 -0
- package/cjs/core/stage.js +3 -0
- package/cjs/core/stage.js.map +1 -1
- package/cjs/core/window.d.ts +5 -4
- package/cjs/core/window.js +14 -13
- package/cjs/core/window.js.map +1 -1
- package/cjs/event/event-system.js +11 -10
- package/cjs/event/event-system.js.map +1 -1
- package/cjs/index.d.ts +2 -0
- package/cjs/index.js +4 -2
- package/cjs/index.js.map +1 -1
- package/cjs/interface/event-listener-manager.d.ts +7 -0
- package/cjs/interface/event-listener-manager.js +6 -0
- package/cjs/interface/event-listener-manager.js.map +1 -0
- package/cjs/interface/global.d.ts +2 -1
- package/cjs/interface/global.js.map +1 -1
- package/cjs/interface/picker.d.ts +1 -0
- package/cjs/interface/picker.js.map +1 -1
- package/cjs/interface/render.d.ts +3 -0
- package/cjs/interface/render.js.map +1 -1
- package/cjs/interface/window.d.ts +1 -0
- package/cjs/interface/window.js.map +1 -1
- package/cjs/picker/global-picker-service.d.ts +1 -0
- package/cjs/picker/global-picker-service.js +1 -0
- package/cjs/picker/global-picker-service.js.map +1 -1
- package/cjs/picker/picker-service.d.ts +1 -0
- package/cjs/picker/picker-service.js +3 -0
- package/cjs/picker/picker-service.js.map +1 -1
- package/cjs/render/contributions/render/arc-render.d.ts +2 -2
- package/cjs/render/contributions/render/arc-render.js +3 -3
- package/cjs/render/contributions/render/arc-render.js.map +1 -1
- package/cjs/render/contributions/render/area-render.d.ts +2 -2
- package/cjs/render/contributions/render/area-render.js +3 -3
- package/cjs/render/contributions/render/area-render.js.map +1 -1
- package/cjs/render/contributions/render/base-render.d.ts +2 -0
- package/cjs/render/contributions/render/base-render.js +3 -0
- package/cjs/render/contributions/render/base-render.js.map +1 -1
- package/cjs/render/contributions/render/circle-render.d.ts +2 -2
- package/cjs/render/contributions/render/circle-render.js +3 -3
- package/cjs/render/contributions/render/circle-render.js.map +1 -1
- package/cjs/render/contributions/render/draw-contribution.d.ts +1 -0
- package/cjs/render/contributions/render/draw-contribution.js +5 -0
- package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
- package/cjs/render/contributions/render/glyph-render.d.ts +1 -0
- package/cjs/render/contributions/render/glyph-render.js +1 -0
- package/cjs/render/contributions/render/glyph-render.js.map +1 -1
- package/cjs/render/contributions/render/graphic-render.d.ts +1 -0
- package/cjs/render/contributions/render/graphic-render.js.map +1 -1
- package/cjs/render/contributions/render/group-render.d.ts +1 -0
- package/cjs/render/contributions/render/group-render.js +4 -0
- package/cjs/render/contributions/render/group-render.js.map +1 -1
- package/cjs/render/contributions/render/image-render.d.ts +2 -2
- package/cjs/render/contributions/render/image-render.js +3 -3
- package/cjs/render/contributions/render/image-render.js.map +1 -1
- package/cjs/render/contributions/render/path-render.d.ts +2 -2
- package/cjs/render/contributions/render/path-render.js +3 -3
- package/cjs/render/contributions/render/path-render.js.map +1 -1
- package/cjs/render/contributions/render/polygon-render.d.ts +2 -2
- package/cjs/render/contributions/render/polygon-render.js +3 -3
- package/cjs/render/contributions/render/polygon-render.js.map +1 -1
- package/cjs/render/contributions/render/rect-render.d.ts +2 -2
- package/cjs/render/contributions/render/rect-render.js +3 -3
- package/cjs/render/contributions/render/rect-render.js.map +1 -1
- package/cjs/render/contributions/render/symbol-render.d.ts +2 -2
- package/cjs/render/contributions/render/symbol-render.js +3 -3
- package/cjs/render/contributions/render/symbol-render.js.map +1 -1
- package/cjs/render/contributions/render/text-render.d.ts +2 -2
- package/cjs/render/contributions/render/text-render.js +3 -3
- package/cjs/render/contributions/render/text-render.js.map +1 -1
- package/cjs/render/render-service.d.ts +1 -0
- package/cjs/render/render-service.js +3 -0
- package/cjs/render/render-service.js.map +1 -1
- package/dist/index.es.js +278 -85
- package/es/common/contribution-provider.d.ts +16 -0
- package/es/common/contribution-provider.js +20 -1
- package/es/common/contribution-provider.js.map +1 -1
- package/es/common/event-listener-manager.d.ts +14 -0
- package/es/common/event-listener-manager.js +44 -0
- package/es/common/event-listener-manager.js.map +1 -0
- package/es/common/event-transformer.d.ts +12 -0
- package/es/common/event-transformer.js +63 -0
- package/es/common/event-transformer.js.map +1 -0
- package/es/common/polygon.js +1 -2
- package/es/common/render-area.js +2 -1
- package/es/common/sort.js +1 -1
- package/es/common/split-path.js +1 -1
- package/es/core/global.d.ts +7 -5
- package/es/core/global.js +14 -12
- package/es/core/global.js.map +1 -1
- package/es/core/stage.d.ts +1 -0
- package/es/core/stage.js +3 -0
- package/es/core/stage.js.map +1 -1
- package/es/core/window.d.ts +5 -4
- package/es/core/window.js +15 -12
- package/es/core/window.js.map +1 -1
- package/es/event/event-system.js +11 -10
- package/es/event/event-system.js.map +1 -1
- package/es/index.d.ts +2 -0
- package/es/index.js +4 -0
- package/es/index.js.map +1 -1
- package/es/interface/event-listener-manager.d.ts +7 -0
- package/es/interface/event-listener-manager.js +2 -0
- package/es/interface/event-listener-manager.js.map +1 -0
- package/es/interface/global.d.ts +2 -1
- package/es/interface/global.js.map +1 -1
- package/es/interface/picker.d.ts +1 -0
- package/es/interface/picker.js.map +1 -1
- package/es/interface/render.d.ts +3 -0
- package/es/interface/render.js.map +1 -1
- package/es/interface/window.d.ts +1 -0
- package/es/interface/window.js.map +1 -1
- package/es/picker/global-picker-service.d.ts +1 -0
- package/es/picker/global-picker-service.js +1 -0
- package/es/picker/global-picker-service.js.map +1 -1
- package/es/picker/picker-service.d.ts +1 -0
- package/es/picker/picker-service.js +3 -0
- package/es/picker/picker-service.js.map +1 -1
- package/es/render/contributions/render/arc-render.d.ts +2 -2
- package/es/render/contributions/render/arc-render.js +3 -3
- package/es/render/contributions/render/arc-render.js.map +1 -1
- package/es/render/contributions/render/area-render.d.ts +2 -2
- package/es/render/contributions/render/area-render.js +3 -3
- package/es/render/contributions/render/area-render.js.map +1 -1
- package/es/render/contributions/render/base-render.d.ts +2 -0
- package/es/render/contributions/render/base-render.js +3 -0
- package/es/render/contributions/render/base-render.js.map +1 -1
- package/es/render/contributions/render/circle-render.d.ts +2 -2
- package/es/render/contributions/render/circle-render.js +3 -3
- package/es/render/contributions/render/circle-render.js.map +1 -1
- package/es/render/contributions/render/draw-contribution.d.ts +1 -0
- package/es/render/contributions/render/draw-contribution.js +5 -0
- package/es/render/contributions/render/draw-contribution.js.map +1 -1
- package/es/render/contributions/render/glyph-render.d.ts +1 -0
- package/es/render/contributions/render/glyph-render.js +1 -0
- package/es/render/contributions/render/glyph-render.js.map +1 -1
- package/es/render/contributions/render/graphic-render.d.ts +1 -0
- package/es/render/contributions/render/graphic-render.js.map +1 -1
- package/es/render/contributions/render/group-render.d.ts +1 -0
- package/es/render/contributions/render/group-render.js +4 -0
- package/es/render/contributions/render/group-render.js.map +1 -1
- package/es/render/contributions/render/image-render.d.ts +2 -2
- package/es/render/contributions/render/image-render.js +3 -3
- package/es/render/contributions/render/image-render.js.map +1 -1
- package/es/render/contributions/render/path-render.d.ts +2 -2
- package/es/render/contributions/render/path-render.js +3 -3
- package/es/render/contributions/render/path-render.js.map +1 -1
- package/es/render/contributions/render/polygon-render.d.ts +2 -2
- package/es/render/contributions/render/polygon-render.js +3 -3
- package/es/render/contributions/render/polygon-render.js.map +1 -1
- package/es/render/contributions/render/rect-render.d.ts +2 -2
- package/es/render/contributions/render/rect-render.js +3 -3
- package/es/render/contributions/render/rect-render.js.map +1 -1
- package/es/render/contributions/render/symbol-render.d.ts +2 -2
- package/es/render/contributions/render/symbol-render.js +3 -3
- package/es/render/contributions/render/symbol-render.js.map +1 -1
- package/es/render/contributions/render/text-render.d.ts +2 -2
- package/es/render/contributions/render/text-render.js +3 -3
- package/es/render/contributions/render/text-render.js.map +1 -1
- package/es/render/render-service.d.ts +1 -0
- package/es/render/render-service.js +3 -0
- package/es/render/render-service.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/render/contributions/render/base-render.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,kDAAkD,CAAC;AACjG,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,sCAAsC,EAAE,uCAAuC,EAAE,MAAM,iBAAiB,CAAC;AAElH,MAAM,MAAM,GAAsD,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC;AAE9G,MAAM,OAAgB,UAAU;IAY9B,IAAI,CAAC,aAAiF;QACpF,IAAI,aAAa,EAAE;YAEjB,IAAI,CAAC,oBAAoB,GAAG,aAAa,CAAC,gBAAgB,EAAE,CAAC;SAC9D;QACD,IAAI,CAAC,IAAI,CAAC,oBAAo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CAAC,CAAC;QAEX,IAAI,OAAO,CAAC,WAAW,KAAK,eAAe,EAAE;YAC3C,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;SACxC;QACD,OAAO,CAAC,WAAW,GAAG,eAAe,CAAC;QAEtC,OAAO,CAAC,sBAAsB,EAAE,CAAC;IACnC,CAAC;CAsHF","file":"base-render.js","sourcesContent":["import type { IPointLike } from '@visactor/vutils';\nimport type {\n IGraphicAttribute,\n ICamera,\n IContext2d,\n IGraphic,\n mat4,\n IDrawContext,\n IGraphicRenderDrawParams,\n IMarkAttribute,\n IThemeAttribute,\n IContributionProvider,\n IBaseRenderContribution,\n ITransform\n} from '../../../interface';\nimport { getModelMatrix, shouldUseMat4 } from '../../../graphic/graphic-service/graphic-service';\nimport { mat4Allocate } from '../../../allocator/matrix-allocate';\nimport { fillVisible, runFill, runStroke, strokeVisible } from './utils';\nimport { BaseRenderContributionTime } from '../../../common/enums';\nimport { multiplyMat4Mat4 } from '../../../common/matrix';\nimport { getTheme } from '../../../graphic';\nimport { renderCommandList } from '../../../common/render-command-list';\nimport { defaultBaseClipRenderAfterContribution, defaultBaseClipRenderBeforeContribution } from './contributions';\n\nconst result: IPointLike & { z: number; lastModelMatrix: mat4 } = { x: 0, y: 0, z: 0, lastModelMatrix: null };\n\nexport abstract class BaseRender<T extends IGraphic> {\n camera: ICamera;\n declare z: number;\n\n builtinContributions: IBaseRenderContribution<T, T['attribute']>[];\n\n // declare renderContribitions: IContributionProvider<IBaseRenderContribution<T, T['attribute']>> | null;\n\n protected _beforeRenderContribitions: IBaseRenderContribution<T, T['attribute']>[];\n protected _afterRenderContribitions: IBaseRenderContribution<T, T['attribute']>[];\n protected _renderContribitions: IBaseRenderContribution<T, T['attribute']>[];\n\n init(contributions?: IContributionProvider<IBaseRenderContribution<T, T['attribute']>>) {\n if (contributions) {\n // this.renderContribitions = contributions;\n this._renderContribitions = contributions.getContributions();\n }\n if (!this._renderContribitions) {\n this._renderContribitions = [];\n }\n if (!this.builtinContributions) {\n this.builtinContributions = [];\n }\n this.builtinContributions.push(defaultBaseClipRenderBeforeContribution);\n this.builtinContributions.push(defaultBaseClipRenderAfterContribution);\n this.builtinContributions.forEach(item => this._renderContribitions.push(item));\n if (this._renderContribitions.length) {\n this._renderContribitions.sort((a, b) => b.order - a.order);\n this._beforeRenderContribitions = this._renderContribitions.filter(\n c => c.time === BaseRenderContributionTime.beforeFillStroke\n );\n this._afterRenderContribitions = this._renderContribitions.filter(\n c => c.time === BaseRenderContributionTime.afterFillStroke\n );\n }\n }\n\n beforeRenderStep(\n graphic: T,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n graphicAttribute: Required<T['attribute']>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n params?: any\n ) {\n this._beforeRenderContribitions &&\n this._beforeRenderContribitions.forEach(c => {\n if (\n c.supportedAppName &&\n graphic.stage &&\n graphic.stage.params &&\n graphic.stage.params.context &&\n graphic.stage.params.context.appName\n ) {\n const names = Array.isArray(c.supportedAppName) ? c.supportedAppName : [c.supportedAppName];\n if (!names.includes(graphic.stage.params.context.appName)) {\n return;\n }\n }\n c.drawShape(\n graphic,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n graphicAttribute,\n drawContext,\n fillCb,\n strokeCb,\n params\n );\n });\n }\n\n afterRenderStep(\n graphic: T,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n graphicAttribute: Required<T['attribute']>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n params?: any\n ) {\n this._afterRenderContribitions &&\n this._afterRenderContribitions.forEach(c => {\n if (\n c.supportedAppName &&\n graphic.stage &&\n graphic.stage.params &&\n graphic.stage.params.context &&\n graphic.stage.params.context.appName\n ) {\n const names = Array.isArray(c.supportedAppName) ? c.supportedAppName : [c.supportedAppName];\n if (!names.includes(graphic.stage.params.context.appName)) {\n return;\n }\n }\n c.drawShape(\n graphic,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n graphicAttribute,\n drawContext,\n fillCb,\n strokeCb,\n params\n );\n });\n }\n\n drawPathProxy(\n graphic: T,\n context: IContext2d,\n x: number,\n y: number,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n if (!graphic.pathProxy) {\n return false;\n }\n\n const themeAttributes = (getTheme(graphic, params?.theme) as any)[graphic.type.replace('3d', '')];\n\n const {\n fill = themeAttributes.fill,\n stroke = themeAttributes.stroke,\n opacity = themeAttributes.opacity,\n fillOpacity = themeAttributes.fillOpacity,\n lineWidth = themeAttributes.lineWidth,\n strokeOpacity = themeAttributes.strokeOpacity,\n visible = themeAttributes.visible,\n x: originX = themeAttributes.x,\n y: originY = themeAttributes.y\n } = graphic.attribute;\n // 不绘制或者透明\n const fVisible = fillVisible(opacity, fillOpacity, fill);\n const sVisible = strokeVisible(opacity, strokeOpacity);\n const doFill = runFill(fill);\n const doStroke = runStroke(stroke, lineWidth);\n\n if (!visible) {\n return true;\n }\n\n if (!(doFill || doStroke)) {\n return true;\n }\n\n // 如果存在fillCb和strokeCb,那就不直接跳过\n if (!(fVisible || sVisible || fillCb || strokeCb)) {\n return true;\n }\n\n context.beginPath();\n const path = typeof graphic.pathProxy === 'function' ? graphic.pathProxy(graphic.attribute) : graphic.pathProxy;\n renderCommandList(path.commandList, context, x, y);\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(graphic, graphic.attribute, themeAttributes);\n\n this.beforeRenderStep(\n graphic,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n themeAttributes,\n drawContext,\n fillCb,\n strokeCb\n );\n\n if (doStroke) {\n if (strokeCb) {\n strokeCb(context, graphic.attribute, themeAttributes);\n } else if (sVisible) {\n context.setStrokeStyle(graphic, graphic.attribute, x - originX, y - originY, themeAttributes);\n context.stroke();\n }\n }\n if (doFill) {\n if (fillCb) {\n fillCb(context, graphic.attribute, themeAttributes);\n } else if (fVisible) {\n context.setCommonStyle(graphic, graphic.attribute, x - originX, y - originY, themeAttributes);\n context.fill();\n }\n }\n\n this.afterRenderStep(\n graphic,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n themeAttributes,\n drawContext,\n fillCb,\n strokeCb\n );\n return true;\n }\n\n valid(graphic: IGraphic, defaultAttribute: IGraphicAttribute, fillCb?: any, strokeCb?: any) {\n const {\n fill = defaultAttribute.fill,\n background,\n stroke = defaultAttribute.stroke,\n opacity = defaultAttribute.opacity,\n fillOpacity = defaultAttribute.fillOpacity,\n lineWidth = defaultAttribute.lineWidth,\n strokeOpacity = defaultAttribute.strokeOpacity,\n visible = defaultAttribute.visible\n } = graphic.attribute;\n const fVisible = fillVisible(opacity, fillOpacity, fill);\n const sVisible = strokeVisible(opacity, strokeOpacity);\n const doFill = runFill(fill, background);\n const doStroke = runStroke(stroke, lineWidth);\n\n if (!(graphic.valid && visible)) {\n return false;\n }\n\n if (!(doFill || doStroke)) {\n return false;\n }\n\n // 如果存在fillCb和strokeCb,以及background那就不直接跳过\n if (!(fVisible || sVisible || fillCb || strokeCb || background)) {\n return false;\n }\n return {\n fVisible,\n sVisible,\n doFill,\n doStroke\n };\n }\n\n /**\n * 进行2d或3d变换\n * @param graphic\n * @param graphicAttribute\n * @param context\n * @param use3dMatrixIn3dMode 是否在3d模式使用3d矩阵\n * @returns\n */\n transform(\n graphic: IGraphic,\n graphicAttribute: Partial<IGraphicAttribute>,\n context: IContext2d,\n use3dMatrixIn3dMode: boolean = false\n ): IPointLike & { z: number; lastModelMatrix: mat4 } {\n // const transMatrix = graphic.transMatrix;\n const {\n x = graphicAttribute.x,\n y = graphicAttribute.y,\n z = graphicAttribute.z,\n scaleX = graphicAttribute.scaleX,\n scaleY = graphicAttribute.scaleY,\n angle = graphicAttribute.angle,\n postMatrix\n } = graphic.attribute;\n // const onlyTranslate = transMatrix.onlyTranslate() && !postMatrix;\n\n // 存在3d变换的时候,需要计算3d矩阵\n const lastModelMatrix = context.modelMatrix;\n const camera = context.camera;\n // const result: IPointLike & { z: number; lastModelMatrix: mat4 } = { x, y, z, lastModelMatrix };\n result.x = x;\n result.y = y;\n result.z = z;\n result.lastModelMatrix = lastModelMatrix;\n\n // 是否应该进行3d变换\n const shouldTransform3d = camera && (use3dMatrixIn3dMode || shouldUseMat4(graphic));\n\n // 是否仅有translate\n const onlyTranslate = shouldTransform3d\n ? graphic.transMatrix.onlyTranslate() && !postMatrix\n : scaleX === 1 && scaleY === 1 && angle === 0 && !postMatrix;\n\n if (shouldTransform3d) {\n const nextModelMatrix = mat4Allocate.allocate();\n // 计算模型矩阵\n const modelMatrix = mat4Allocate.allocate();\n getModelMatrix(modelMatrix, graphic, graphicAttribute as ITransform);\n // 合并模型矩阵\n if (lastModelMatrix) {\n multiplyMat4Mat4(nextModelMatrix, lastModelMatrix, modelMatrix);\n } else {\n multiplyMat4Mat4(nextModelMatrix, nextModelMatrix, modelMatrix);\n }\n result.x = 0;\n result.y = 0;\n result.z = 0;\n context.modelMatrix = nextModelMatrix;\n context.setTransform(1, 0, 0, 1, 0, 0, true);\n mat4Allocate.free(modelMatrix);\n // 有旋转的情况下需要手动计算模型矩阵\n // TODO: 这里暂时都使用模型矩阵,因为视角旋转的时候如果当不固定角度那也需要用到模型矩阵\n }\n\n // 如果只有位移,且没计算3d变换矩阵,那么不设置context的2d矩阵\n if (onlyTranslate && !lastModelMatrix) {\n const point = graphic.getOffsetXY(graphicAttribute as ITransform);\n result.x += point.x;\n result.y += point.y;\n result.z = z;\n // 当前context有rotate/scale,重置matrix\n context.setTransformForCurrent();\n } else if (shouldTransform3d) {\n // 如果计算了3d矩阵,那么就不需要2d矩阵计算了\n result.x = 0;\n result.y = 0;\n result.z = 0;\n context.setTransform(1, 0, 0, 1, 0, 0, true);\n } else {\n if (camera && context.project) {\n const point = graphic.getOffsetXY(graphicAttribute as ITransform);\n result.x += point.x;\n result.y += point.y;\n // result.x = 0;\n // result.y = 0;\n // 位置直接通过project设置,而2d变换通过变换矩阵完成\n this.transformWithoutTranslate(context, result.x, result.y, result.z, scaleX, scaleY, angle);\n } else {\n // 如果是纯2d的情况,那么直接设置context的2d矩阵\n // 性能较差\n context.transformFromMatrix(graphic.transMatrix, true);\n result.x = 0;\n result.y = 0;\n result.z = 0;\n }\n }\n\n return result;\n }\n\n /**\n * 将3d的transform转成context2d的transform\n * @param graphic\n * @param graphicAttribute\n * @param z\n * @param context\n */\n transformUseContext2d(graphic: IGraphic, graphicAttribute: IGraphicAttribute, z: number, context: IContext2d) {\n const camera = context.camera;\n this.camera = camera;\n if (camera) {\n const bounds = graphic.AABBBounds;\n const width = bounds.x2 - bounds.x1;\n const height = bounds.y2 - bounds.y1;\n const p1 = context.project(0, 0, z);\n const p2 = context.project(width, 0, z);\n const p3 = context.project(width, height, z);\n const _p1 = { x: 0, y: 0 };\n const _p2 = { x: width, y: 0 };\n const _p3 = { x: width, y: height };\n\n context.camera = null;\n\n // 生成3维矩阵\n /* Adapted from phoria.js by ecomfe\n * https://github.com/kevinroast/phoria.js\n * Licensed under the BSD-3-Clause\n\n * url: https://github.com/kevinroast/phoria.js/blob/736c6b854a679df180f8a6e689aeb218efa6dc01/scripts/phoria-renderer.js\n * License: https://github.com/kevinroast/phoria.js/blob/master/LICENSE\n * @license\n */\n const denom = 1.0 / (_p1.x * (_p3.y - _p2.y) - _p2.x * _p3.y + _p3.x * _p2.y + (_p2.x - _p3.x) * _p1.y);\n // calculate context transformation matrix\n const m11 = -(_p1.y * (p3.x - p2.x) - _p2.y * p3.x + _p3.y * p2.x + (_p2.y - _p3.y) * p1.x) * denom;\n const m12 = (_p2.y * p3.y + _p1.y * (p2.y - p3.y) - _p3.y * p2.y + (_p3.y - _p2.y) * p1.y) * denom;\n const m21 = (_p1.x * (p3.x - p2.x) - _p2.x * p3.x + _p3.x * p2.x + (_p2.x - _p3.x) * p1.x) * denom;\n const m22 = -(_p2.x * p3.y + _p1.x * (p2.y - p3.y) - _p3.x * p2.y + (_p3.x - _p2.x) * p1.y) * denom;\n const dx =\n (_p1.x * (_p3.y * p2.x - _p2.y * p3.x) +\n _p1.y * (_p2.x * p3.x - _p3.x * p2.x) +\n (_p3.x * _p2.y - _p2.x * _p3.y) * p1.x) *\n denom;\n const dy =\n (_p1.x * (_p3.y * p2.y - _p2.y * p3.y) +\n _p1.y * (_p2.x * p3.y - _p3.x * p2.y) +\n (_p3.x * _p2.y - _p2.x * _p3.y) * p1.y) *\n denom;\n\n context.setTransform(m11, m12, m21, m22, dx, dy, true);\n }\n }\n\n /**\n * transformUseContext2d的后处理\n * @param graphic\n * @param graphicAttribute\n * @param z\n * @param context\n */\n restoreTransformUseContext2d(graphic: IGraphic, graphicAttribute: IGraphicAttribute, z: number, context: IContext2d) {\n if (this.camera) {\n context.camera = this.camera;\n }\n }\n\n protected transformWithoutTranslate(\n context: IContext2d,\n x: number,\n y: number,\n z: number,\n scaleX: number,\n scaleY: number,\n angle: number\n ) {\n const p = context.project(x, y, z);\n context.translate(p.x, p.y, false);\n context.scale(scaleX, scaleY, false);\n context.rotate(angle, false);\n context.translate(-p.x, -p.y, false);\n context.setTransformForCurrent();\n }\n\n _draw(\n graphic: T,\n defaultAttr: IGraphicAttribute,\n computed3dMatrix: boolean,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams\n ) {\n const { context } = drawContext;\n if (!context) {\n return;\n }\n // 如果hide,直接跳过后续绘制\n const { renderable } = graphic.attribute;\n if (renderable === false) {\n return;\n }\n\n context.highPerformanceSave();\n\n const data = this.transform(graphic, defaultAttr, context, computed3dMatrix);\n const { x, y, z, lastModelMatrix } = data;\n\n this.z = z;\n if (this.drawPathProxy(graphic, context, x, y, drawContext, params)) {\n context.highPerformanceRestore();\n return;\n }\n\n this.drawShape(graphic, context, x, y, drawContext, params);\n this.z = 0;\n\n if (context.modelMatrix !== lastModelMatrix) {\n mat4Allocate.free(context.modelMatrix);\n }\n context.modelMatrix = lastModelMatrix;\n\n context.highPerformanceRestore();\n }\n\n drawShape?(\n path: T,\n context: IContext2d,\n x: number,\n y: number,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ): void;\n\n // abstract drawShape(\n // graphic: T,\n // context: IContext2d,\n // x: number,\n // y: number,\n // drawContext: IDrawContext,\n // params?: IGraphicRenderDrawParams,\n // fillCb?: (\n // ctx: IContext2d,\n // markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n // themeAttribute: IThemeAttribute\n // ) => boolean,\n // strokeCb?: (\n // ctx: IContext2d,\n // markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n // themeAttribute: IThemeAttribute\n // ) => boolean\n // ): void;\n\n // drawPathProxy(\n // graphic: T,\n // context: IContext2d,\n // x: number,\n // y: number,\n // drawContext: IDrawContext,\n // params?: IGraphicRenderDrawParams,\n // fillCb?: (\n // ctx: IContext2d,\n // markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n // themeAttribute: IThemeAttribute\n // ) => boolean,\n // strokeCb?: (\n // ctx: IContext2d,\n // markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n // themeAttribute: IThemeAttribute\n // ) => boolean\n // ) {\n // if (!graphic.pathProxy) {\n // return false;\n // }\n\n // const themeAttributes = getTheme(graphic)[graphic.type];\n\n // const {\n // fill = themeAttributes.fill == null ? !!graphic.attribute.fillColor : themeAttributes.fill,\n // stroke = themeAttributes.stroke == null ? !!graphic.attribute.strokeColor : themeAttributes.stroke,\n // opacity = themeAttributes.opacity,\n // fillOpacity = themeAttributes.fillOpacity,\n // lineWidth = themeAttributes.lineWidth,\n // strokeOpacity = themeAttributes.strokeOpacity,\n // visible = themeAttributes.visible\n // } = graphic.attribute;\n // // 不绘制或者透明\n // const fVisible = fillVisible(opacity, fillOpacity);\n // const sVisible = strokeVisible(opacity, strokeOpacity);\n // const doFill = runFill(fill);\n // const doStroke = runStroke(stroke, lineWidth);\n\n // if (!visible) {\n // return true;\n // }\n\n // if (!(doFill || doStroke)) {\n // return true;\n // }\n\n // // 如果存在fillCb和strokeCb,那就不直接跳过\n // if (!(fVisible || sVisible || fillCb || strokeCb)) {\n // return true;\n // }\n\n // context.beginPath();\n\n // const path = typeof graphic.pathProxy === 'function' ? graphic.pathProxy(graphic.attribute) : graphic.pathProxy;\n // renderCommandList(path.commandList, context, x, y);\n\n // // shadow\n // context.setShadowBlendStyle && context.setShadowBlendStyle(graphic, graphic.attribute, themeAttributes);\n\n // if (doStroke) {\n // if (strokeCb) {\n // strokeCb(context, graphic.attribute, themeAttributes);\n // } else if (sVisible) {\n // context.setStrokeStyle(graphic, graphic.attribute, 0, 0, themeAttributes);\n // context.stroke();\n // }\n // }\n // if (doFill) {\n // if (fillCb) {\n // fillCb(context, graphic.attribute, themeAttributes);\n // } else if (fVisible) {\n // context.setCommonStyle(graphic, graphic.attribute, 0, 0, themeAttributes);\n // context.fill();\n // }\n // }\n // return true;\n // }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/render/contributions/render/base-render.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,kDAAkD,CAAC;AACjG,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,sCAAsC,EAAE,uCAAuC,EAAE,MAAM,iBAAiB,CAAC;AAElH,MAAM,MAAM,GAAsD,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC;AAE9G,MAAM,OAAgB,UAAU;IAa9B,IAAI,CAAC,aAAiF;QACpF,IAAI,aAAa,EAAE;YAEjB,IAAI,CAAC,oBAAoB,GAAG,aAAa,CAAC,gBAAgB,EAAE,CAAC;SAC9D;QACD,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE;YAC9B,IAAI,CAAC,oBAAoB,GAAG,EAAE,CAAC;SAChC;QACD,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE;YAC9B,IAAI,CAAC,oBAAoB,GAAG,EAAE,CAAC;SAChC;QACD,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;QACxE,IAAI,CAAC,oBAAoB,CAAC,IAAI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AEtC,OAAO,CAAC,sBAAsB,EAAE,CAAC;IACnC,CAAC;CAsHF","file":"base-render.js","sourcesContent":["import type { IPointLike } from '@visactor/vutils';\nimport type {\n IGraphicAttribute,\n ICamera,\n IContext2d,\n IGraphic,\n mat4,\n IDrawContext,\n IGraphicRenderDrawParams,\n IMarkAttribute,\n IThemeAttribute,\n IContributionProvider,\n IBaseRenderContribution,\n ITransform\n} from '../../../interface';\nimport { getModelMatrix, shouldUseMat4 } from '../../../graphic/graphic-service/graphic-service';\nimport { mat4Allocate } from '../../../allocator/matrix-allocate';\nimport { fillVisible, runFill, runStroke, strokeVisible } from './utils';\nimport { BaseRenderContributionTime } from '../../../common/enums';\nimport { multiplyMat4Mat4 } from '../../../common/matrix';\nimport { getTheme } from '../../../graphic';\nimport { renderCommandList } from '../../../common/render-command-list';\nimport { defaultBaseClipRenderAfterContribution, defaultBaseClipRenderBeforeContribution } from './contributions';\n\nconst result: IPointLike & { z: number; lastModelMatrix: mat4 } = { x: 0, y: 0, z: 0, lastModelMatrix: null };\n\nexport abstract class BaseRender<T extends IGraphic> {\n camera: ICamera;\n declare z: number;\n\n builtinContributions: IBaseRenderContribution<T, T['attribute']>[];\n protected declare graphicRenderContributions: IContributionProvider<IBaseRenderContribution<T, T['attribute']>>;\n\n // declare renderContribitions: IContributionProvider<IBaseRenderContribution<T, T['attribute']>> | null;\n\n protected _beforeRenderContribitions: IBaseRenderContribution<T, T['attribute']>[];\n protected _afterRenderContribitions: IBaseRenderContribution<T, T['attribute']>[];\n protected _renderContribitions: IBaseRenderContribution<T, T['attribute']>[];\n\n init(contributions?: IContributionProvider<IBaseRenderContribution<T, T['attribute']>>) {\n if (contributions) {\n // this.renderContribitions = contributions;\n this._renderContribitions = contributions.getContributions();\n }\n if (!this._renderContribitions) {\n this._renderContribitions = [];\n }\n if (!this.builtinContributions) {\n this.builtinContributions = [];\n }\n this.builtinContributions.push(defaultBaseClipRenderBeforeContribution);\n this.builtinContributions.push(defaultBaseClipRenderAfterContribution);\n this.builtinContributions.forEach(item => this._renderContribitions.push(item));\n if (this._renderContribitions.length) {\n this._renderContribitions.sort((a, b) => b.order - a.order);\n this._beforeRenderContribitions = this._renderContribitions.filter(\n c => c.time === BaseRenderContributionTime.beforeFillStroke\n );\n this._afterRenderContribitions = this._renderContribitions.filter(\n c => c.time === BaseRenderContributionTime.afterFillStroke\n );\n }\n }\n\n reInit() {\n this.init(this.graphicRenderContributions);\n }\n\n beforeRenderStep(\n graphic: T,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n graphicAttribute: Required<T['attribute']>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n params?: any\n ) {\n this._beforeRenderContribitions &&\n this._beforeRenderContribitions.forEach(c => {\n if (\n c.supportedAppName &&\n graphic.stage &&\n graphic.stage.params &&\n graphic.stage.params.context &&\n graphic.stage.params.context.appName\n ) {\n const names = Array.isArray(c.supportedAppName) ? c.supportedAppName : [c.supportedAppName];\n if (!names.includes(graphic.stage.params.context.appName)) {\n return;\n }\n }\n c.drawShape(\n graphic,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n graphicAttribute,\n drawContext,\n fillCb,\n strokeCb,\n params\n );\n });\n }\n\n afterRenderStep(\n graphic: T,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n graphicAttribute: Required<T['attribute']>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n params?: any\n ) {\n this._afterRenderContribitions &&\n this._afterRenderContribitions.forEach(c => {\n if (\n c.supportedAppName &&\n graphic.stage &&\n graphic.stage.params &&\n graphic.stage.params.context &&\n graphic.stage.params.context.appName\n ) {\n const names = Array.isArray(c.supportedAppName) ? c.supportedAppName : [c.supportedAppName];\n if (!names.includes(graphic.stage.params.context.appName)) {\n return;\n }\n }\n c.drawShape(\n graphic,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n graphicAttribute,\n drawContext,\n fillCb,\n strokeCb,\n params\n );\n });\n }\n\n drawPathProxy(\n graphic: T,\n context: IContext2d,\n x: number,\n y: number,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n if (!graphic.pathProxy) {\n return false;\n }\n\n const themeAttributes = (getTheme(graphic, params?.theme) as any)[graphic.type.replace('3d', '')];\n\n const {\n fill = themeAttributes.fill,\n stroke = themeAttributes.stroke,\n opacity = themeAttributes.opacity,\n fillOpacity = themeAttributes.fillOpacity,\n lineWidth = themeAttributes.lineWidth,\n strokeOpacity = themeAttributes.strokeOpacity,\n visible = themeAttributes.visible,\n x: originX = themeAttributes.x,\n y: originY = themeAttributes.y\n } = graphic.attribute;\n // 不绘制或者透明\n const fVisible = fillVisible(opacity, fillOpacity, fill);\n const sVisible = strokeVisible(opacity, strokeOpacity);\n const doFill = runFill(fill);\n const doStroke = runStroke(stroke, lineWidth);\n\n if (!visible) {\n return true;\n }\n\n if (!(doFill || doStroke)) {\n return true;\n }\n\n // 如果存在fillCb和strokeCb,那就不直接跳过\n if (!(fVisible || sVisible || fillCb || strokeCb)) {\n return true;\n }\n\n context.beginPath();\n const path = typeof graphic.pathProxy === 'function' ? graphic.pathProxy(graphic.attribute) : graphic.pathProxy;\n renderCommandList(path.commandList, context, x, y);\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(graphic, graphic.attribute, themeAttributes);\n\n this.beforeRenderStep(\n graphic,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n themeAttributes,\n drawContext,\n fillCb,\n strokeCb\n );\n\n if (doStroke) {\n if (strokeCb) {\n strokeCb(context, graphic.attribute, themeAttributes);\n } else if (sVisible) {\n context.setStrokeStyle(graphic, graphic.attribute, x - originX, y - originY, themeAttributes);\n context.stroke();\n }\n }\n if (doFill) {\n if (fillCb) {\n fillCb(context, graphic.attribute, themeAttributes);\n } else if (fVisible) {\n context.setCommonStyle(graphic, graphic.attribute, x - originX, y - originY, themeAttributes);\n context.fill();\n }\n }\n\n this.afterRenderStep(\n graphic,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n themeAttributes,\n drawContext,\n fillCb,\n strokeCb\n );\n return true;\n }\n\n valid(graphic: IGraphic, defaultAttribute: IGraphicAttribute, fillCb?: any, strokeCb?: any) {\n const {\n fill = defaultAttribute.fill,\n background,\n stroke = defaultAttribute.stroke,\n opacity = defaultAttribute.opacity,\n fillOpacity = defaultAttribute.fillOpacity,\n lineWidth = defaultAttribute.lineWidth,\n strokeOpacity = defaultAttribute.strokeOpacity,\n visible = defaultAttribute.visible\n } = graphic.attribute;\n const fVisible = fillVisible(opacity, fillOpacity, fill);\n const sVisible = strokeVisible(opacity, strokeOpacity);\n const doFill = runFill(fill, background);\n const doStroke = runStroke(stroke, lineWidth);\n\n if (!(graphic.valid && visible)) {\n return false;\n }\n\n if (!(doFill || doStroke)) {\n return false;\n }\n\n // 如果存在fillCb和strokeCb,以及background那就不直接跳过\n if (!(fVisible || sVisible || fillCb || strokeCb || background)) {\n return false;\n }\n return {\n fVisible,\n sVisible,\n doFill,\n doStroke\n };\n }\n\n /**\n * 进行2d或3d变换\n * @param graphic\n * @param graphicAttribute\n * @param context\n * @param use3dMatrixIn3dMode 是否在3d模式使用3d矩阵\n * @returns\n */\n transform(\n graphic: IGraphic,\n graphicAttribute: Partial<IGraphicAttribute>,\n context: IContext2d,\n use3dMatrixIn3dMode: boolean = false\n ): IPointLike & { z: number; lastModelMatrix: mat4 } {\n // const transMatrix = graphic.transMatrix;\n const {\n x = graphicAttribute.x,\n y = graphicAttribute.y,\n z = graphicAttribute.z,\n scaleX = graphicAttribute.scaleX,\n scaleY = graphicAttribute.scaleY,\n angle = graphicAttribute.angle,\n postMatrix\n } = graphic.attribute;\n // const onlyTranslate = transMatrix.onlyTranslate() && !postMatrix;\n\n // 存在3d变换的时候,需要计算3d矩阵\n const lastModelMatrix = context.modelMatrix;\n const camera = context.camera;\n // const result: IPointLike & { z: number; lastModelMatrix: mat4 } = { x, y, z, lastModelMatrix };\n result.x = x;\n result.y = y;\n result.z = z;\n result.lastModelMatrix = lastModelMatrix;\n\n // 是否应该进行3d变换\n const shouldTransform3d = camera && (use3dMatrixIn3dMode || shouldUseMat4(graphic));\n\n // 是否仅有translate\n const onlyTranslate = shouldTransform3d\n ? graphic.transMatrix.onlyTranslate() && !postMatrix\n : scaleX === 1 && scaleY === 1 && angle === 0 && !postMatrix;\n\n if (shouldTransform3d) {\n const nextModelMatrix = mat4Allocate.allocate();\n // 计算模型矩阵\n const modelMatrix = mat4Allocate.allocate();\n getModelMatrix(modelMatrix, graphic, graphicAttribute as ITransform);\n // 合并模型矩阵\n if (lastModelMatrix) {\n multiplyMat4Mat4(nextModelMatrix, lastModelMatrix, modelMatrix);\n } else {\n multiplyMat4Mat4(nextModelMatrix, nextModelMatrix, modelMatrix);\n }\n result.x = 0;\n result.y = 0;\n result.z = 0;\n context.modelMatrix = nextModelMatrix;\n context.setTransform(1, 0, 0, 1, 0, 0, true);\n mat4Allocate.free(modelMatrix);\n // 有旋转的情况下需要手动计算模型矩阵\n // TODO: 这里暂时都使用模型矩阵,因为视角旋转的时候如果当不固定角度那也需要用到模型矩阵\n }\n\n // 如果只有位移,且没计算3d变换矩阵,那么不设置context的2d矩阵\n if (onlyTranslate && !lastModelMatrix) {\n const point = graphic.getOffsetXY(graphicAttribute as ITransform);\n result.x += point.x;\n result.y += point.y;\n result.z = z;\n // 当前context有rotate/scale,重置matrix\n context.setTransformForCurrent();\n } else if (shouldTransform3d) {\n // 如果计算了3d矩阵,那么就不需要2d矩阵计算了\n result.x = 0;\n result.y = 0;\n result.z = 0;\n context.setTransform(1, 0, 0, 1, 0, 0, true);\n } else {\n if (camera && context.project) {\n const point = graphic.getOffsetXY(graphicAttribute as ITransform);\n result.x += point.x;\n result.y += point.y;\n // result.x = 0;\n // result.y = 0;\n // 位置直接通过project设置,而2d变换通过变换矩阵完成\n this.transformWithoutTranslate(context, result.x, result.y, result.z, scaleX, scaleY, angle);\n } else {\n // 如果是纯2d的情况,那么直接设置context的2d矩阵\n // 性能较差\n context.transformFromMatrix(graphic.transMatrix, true);\n result.x = 0;\n result.y = 0;\n result.z = 0;\n }\n }\n\n return result;\n }\n\n /**\n * 将3d的transform转成context2d的transform\n * @param graphic\n * @param graphicAttribute\n * @param z\n * @param context\n */\n transformUseContext2d(graphic: IGraphic, graphicAttribute: IGraphicAttribute, z: number, context: IContext2d) {\n const camera = context.camera;\n this.camera = camera;\n if (camera) {\n const bounds = graphic.AABBBounds;\n const width = bounds.x2 - bounds.x1;\n const height = bounds.y2 - bounds.y1;\n const p1 = context.project(0, 0, z);\n const p2 = context.project(width, 0, z);\n const p3 = context.project(width, height, z);\n const _p1 = { x: 0, y: 0 };\n const _p2 = { x: width, y: 0 };\n const _p3 = { x: width, y: height };\n\n context.camera = null;\n\n // 生成3维矩阵\n /* Adapted from phoria.js by ecomfe\n * https://github.com/kevinroast/phoria.js\n * Licensed under the BSD-3-Clause\n\n * url: https://github.com/kevinroast/phoria.js/blob/736c6b854a679df180f8a6e689aeb218efa6dc01/scripts/phoria-renderer.js\n * License: https://github.com/kevinroast/phoria.js/blob/master/LICENSE\n * @license\n */\n const denom = 1.0 / (_p1.x * (_p3.y - _p2.y) - _p2.x * _p3.y + _p3.x * _p2.y + (_p2.x - _p3.x) * _p1.y);\n // calculate context transformation matrix\n const m11 = -(_p1.y * (p3.x - p2.x) - _p2.y * p3.x + _p3.y * p2.x + (_p2.y - _p3.y) * p1.x) * denom;\n const m12 = (_p2.y * p3.y + _p1.y * (p2.y - p3.y) - _p3.y * p2.y + (_p3.y - _p2.y) * p1.y) * denom;\n const m21 = (_p1.x * (p3.x - p2.x) - _p2.x * p3.x + _p3.x * p2.x + (_p2.x - _p3.x) * p1.x) * denom;\n const m22 = -(_p2.x * p3.y + _p1.x * (p2.y - p3.y) - _p3.x * p2.y + (_p3.x - _p2.x) * p1.y) * denom;\n const dx =\n (_p1.x * (_p3.y * p2.x - _p2.y * p3.x) +\n _p1.y * (_p2.x * p3.x - _p3.x * p2.x) +\n (_p3.x * _p2.y - _p2.x * _p3.y) * p1.x) *\n denom;\n const dy =\n (_p1.x * (_p3.y * p2.y - _p2.y * p3.y) +\n _p1.y * (_p2.x * p3.y - _p3.x * p2.y) +\n (_p3.x * _p2.y - _p2.x * _p3.y) * p1.y) *\n denom;\n\n context.setTransform(m11, m12, m21, m22, dx, dy, true);\n }\n }\n\n /**\n * transformUseContext2d的后处理\n * @param graphic\n * @param graphicAttribute\n * @param z\n * @param context\n */\n restoreTransformUseContext2d(graphic: IGraphic, graphicAttribute: IGraphicAttribute, z: number, context: IContext2d) {\n if (this.camera) {\n context.camera = this.camera;\n }\n }\n\n protected transformWithoutTranslate(\n context: IContext2d,\n x: number,\n y: number,\n z: number,\n scaleX: number,\n scaleY: number,\n angle: number\n ) {\n const p = context.project(x, y, z);\n context.translate(p.x, p.y, false);\n context.scale(scaleX, scaleY, false);\n context.rotate(angle, false);\n context.translate(-p.x, -p.y, false);\n context.setTransformForCurrent();\n }\n\n _draw(\n graphic: T,\n defaultAttr: IGraphicAttribute,\n computed3dMatrix: boolean,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams\n ) {\n const { context } = drawContext;\n if (!context) {\n return;\n }\n // 如果hide,直接跳过后续绘制\n const { renderable } = graphic.attribute;\n if (renderable === false) {\n return;\n }\n\n context.highPerformanceSave();\n\n const data = this.transform(graphic, defaultAttr, context, computed3dMatrix);\n const { x, y, z, lastModelMatrix } = data;\n\n this.z = z;\n if (this.drawPathProxy(graphic, context, x, y, drawContext, params)) {\n context.highPerformanceRestore();\n return;\n }\n\n this.drawShape(graphic, context, x, y, drawContext, params);\n this.z = 0;\n\n if (context.modelMatrix !== lastModelMatrix) {\n mat4Allocate.free(context.modelMatrix);\n }\n context.modelMatrix = lastModelMatrix;\n\n context.highPerformanceRestore();\n }\n\n drawShape?(\n path: T,\n context: IContext2d,\n x: number,\n y: number,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ): void;\n\n // abstract drawShape(\n // graphic: T,\n // context: IContext2d,\n // x: number,\n // y: number,\n // drawContext: IDrawContext,\n // params?: IGraphicRenderDrawParams,\n // fillCb?: (\n // ctx: IContext2d,\n // markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n // themeAttribute: IThemeAttribute\n // ) => boolean,\n // strokeCb?: (\n // ctx: IContext2d,\n // markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n // themeAttribute: IThemeAttribute\n // ) => boolean\n // ): void;\n\n // drawPathProxy(\n // graphic: T,\n // context: IContext2d,\n // x: number,\n // y: number,\n // drawContext: IDrawContext,\n // params?: IGraphicRenderDrawParams,\n // fillCb?: (\n // ctx: IContext2d,\n // markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n // themeAttribute: IThemeAttribute\n // ) => boolean,\n // strokeCb?: (\n // ctx: IContext2d,\n // markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n // themeAttribute: IThemeAttribute\n // ) => boolean\n // ) {\n // if (!graphic.pathProxy) {\n // return false;\n // }\n\n // const themeAttributes = getTheme(graphic)[graphic.type];\n\n // const {\n // fill = themeAttributes.fill == null ? !!graphic.attribute.fillColor : themeAttributes.fill,\n // stroke = themeAttributes.stroke == null ? !!graphic.attribute.strokeColor : themeAttributes.stroke,\n // opacity = themeAttributes.opacity,\n // fillOpacity = themeAttributes.fillOpacity,\n // lineWidth = themeAttributes.lineWidth,\n // strokeOpacity = themeAttributes.strokeOpacity,\n // visible = themeAttributes.visible\n // } = graphic.attribute;\n // // 不绘制或者透明\n // const fVisible = fillVisible(opacity, fillOpacity);\n // const sVisible = strokeVisible(opacity, strokeOpacity);\n // const doFill = runFill(fill);\n // const doStroke = runStroke(stroke, lineWidth);\n\n // if (!visible) {\n // return true;\n // }\n\n // if (!(doFill || doStroke)) {\n // return true;\n // }\n\n // // 如果存在fillCb和strokeCb,那就不直接跳过\n // if (!(fVisible || sVisible || fillCb || strokeCb)) {\n // return true;\n // }\n\n // context.beginPath();\n\n // const path = typeof graphic.pathProxy === 'function' ? graphic.pathProxy(graphic.attribute) : graphic.pathProxy;\n // renderCommandList(path.commandList, context, x, y);\n\n // // shadow\n // context.setShadowBlendStyle && context.setShadowBlendStyle(graphic, graphic.attribute, themeAttributes);\n\n // if (doStroke) {\n // if (strokeCb) {\n // strokeCb(context, graphic.attribute, themeAttributes);\n // } else if (sVisible) {\n // context.setStrokeStyle(graphic, graphic.attribute, 0, 0, themeAttributes);\n // context.stroke();\n // }\n // }\n // if (doFill) {\n // if (fillCb) {\n // fillCb(context, graphic.attribute, themeAttributes);\n // } else if (fVisible) {\n // context.setCommonStyle(graphic, graphic.attribute, 0, 0, themeAttributes);\n // context.fill();\n // }\n // }\n // return true;\n // }\n}\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { IGraphicAttribute, ICircle, IContext2d, IMarkAttribute, IThemeAttribute, ICircleRenderContribution, IDrawContext, IRenderService, IGraphicRender, IGraphicRenderDrawParams, IContributionProvider } from '../../../interface';
|
|
2
2
|
import { BaseRender } from './base-render';
|
|
3
3
|
export declare class DefaultCanvasCircleRender extends BaseRender<ICircle> implements IGraphicRender {
|
|
4
|
-
protected readonly
|
|
4
|
+
protected readonly graphicRenderContributions: IContributionProvider<ICircleRenderContribution>;
|
|
5
5
|
type: 'circle';
|
|
6
6
|
numberType: number;
|
|
7
|
-
constructor(
|
|
7
|
+
constructor(graphicRenderContributions: IContributionProvider<ICircleRenderContribution>);
|
|
8
8
|
drawShape(circle: ICircle, context: IContext2d, x: number, y: number, drawContext: IDrawContext, params?: IGraphicRenderDrawParams, fillCb?: (ctx: IContext2d, markAttribute: Partial<IMarkAttribute & IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean, strokeCb?: (ctx: IContext2d, markAttribute: Partial<IMarkAttribute & IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean): void;
|
|
9
9
|
draw(circle: ICircle, renderService: IRenderService, drawContext: IDrawContext, params?: IGraphicRenderDrawParams): void;
|
|
10
10
|
}
|
|
@@ -25,10 +25,10 @@ import { BaseRender } from "./base-render";
|
|
|
25
25
|
import { defaultCircleBackgroundRenderContribution, defaultCircleRenderContribution, defaultCircleTextureRenderContribution } from "./contributions";
|
|
26
26
|
|
|
27
27
|
let DefaultCanvasCircleRender = class extends BaseRender {
|
|
28
|
-
constructor(
|
|
29
|
-
super(), this.
|
|
28
|
+
constructor(graphicRenderContributions) {
|
|
29
|
+
super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = CIRCLE_NUMBER_TYPE,
|
|
30
30
|
this.builtinContributions = [ defaultCircleRenderContribution, defaultCircleBackgroundRenderContribution, defaultCircleTextureRenderContribution ],
|
|
31
|
-
this.init(
|
|
31
|
+
this.init(graphicRenderContributions);
|
|
32
32
|
}
|
|
33
33
|
drawShape(circle, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
34
34
|
const circleAttribute = getTheme(circle, null == params ? void 0 : params.theme).circle, {radius: radius = circleAttribute.radius, startAngle: startAngle = circleAttribute.startAngle, endAngle: endAngle = circleAttribute.endAngle, x: originX = circleAttribute.x, y: originY = circleAttribute.y, fillStrokeOrder: fillStrokeOrder = circleAttribute.fillStrokeOrder} = circle.attribute, data = this.valid(circle, circleAttribute, fillCb, strokeCb);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/render/contributions/render/circle-render.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAc3E,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAErE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EACL,yCAAyC,EACzC,+BAA+B,EAC/B,sCAAsC,EACvC,MAAM,iBAAiB,CAAC;AAGlB,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,UAAmB;IAIhE,YAGqB,
|
|
1
|
+
{"version":3,"sources":["../src/render/contributions/render/circle-render.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAc3E,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,wBAA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AAe,CAAC,CAAC;oBAC5F,OAAO,CAAC,MAAM,EAAE,CAAC;iBAClB;aACF;QACH,CAAC,CAAC;QAEF,IAAI,CAAC,eAAe,EAAE;YACpB,QAAQ,EAAE,CAAC;YACX,UAAU,EAAE,CAAC;SACd;aAAM;YACL,UAAU,EAAE,CAAC;YACb,QAAQ,EAAE,CAAC;SACZ;QAED,IAAI,CAAC,eAAe,CAClB,MAAM,EACN,OAAO,EACP,CAAC,EACD,CAAC,EACD,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,WAAW,EACX,MAAM,EACN,QAAQ,CACT,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,MAAe,EAAE,aAA6B,EAAE,WAAyB,EAAE,MAAiC;QAC/G,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAC,CAAC,MAAM,CAAC;QAC/D,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IAClE,CAAC;CACF,CAAA;AA7HY,yBAAyB;IADrC,UAAU,EAAE;IAMR,WAAA,MAAM,CAAC,oBAAoB,CAAC,CAAA;IAC5B,WAAA,KAAK,CAAC,wBAAwB,CAAC,CAAA;;GANvB,yBAAyB,CA6HrC;SA7HY,yBAAyB","file":"circle-render.js","sourcesContent":["import { inject, injectable, named } from '../../../common/inversify-lite';\nimport type {\n IGraphicAttribute,\n ICircle,\n IContext2d,\n IMarkAttribute,\n IThemeAttribute,\n ICircleRenderContribution,\n IDrawContext,\n IRenderService,\n IGraphicRender,\n IGraphicRenderDrawParams,\n IContributionProvider\n} from '../../../interface';\nimport { getTheme } from '../../../graphic/theme';\nimport { CIRCLE_NUMBER_TYPE } from '../../../graphic/constants';\nimport { CircleRenderContribution } from './contributions/constants';\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport { ContributionProvider } from '../../../common/contribution-provider';\nimport { BaseRender } from './base-render';\nimport {\n defaultCircleBackgroundRenderContribution,\n defaultCircleRenderContribution,\n defaultCircleTextureRenderContribution\n} from './contributions';\n\n@injectable()\nexport class DefaultCanvasCircleRender extends BaseRender<ICircle> implements IGraphicRender {\n type: 'circle';\n numberType: number = CIRCLE_NUMBER_TYPE;\n\n constructor(\n @inject(ContributionProvider)\n @named(CircleRenderContribution)\n protected readonly graphicRenderContributions: IContributionProvider<ICircleRenderContribution>\n ) {\n super();\n this.builtinContributions = [\n defaultCircleRenderContribution,\n defaultCircleBackgroundRenderContribution,\n defaultCircleTextureRenderContribution\n ];\n this.init(graphicRenderContributions);\n }\n\n drawShape(\n circle: ICircle,\n context: IContext2d,\n x: number,\n y: number,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n // const circleAttribute = graphicService.themeService.getCurrentTheme().circleAttribute;\n const circleAttribute = getTheme(circle, params?.theme).circle;\n const {\n radius = circleAttribute.radius,\n startAngle = circleAttribute.startAngle,\n endAngle = circleAttribute.endAngle,\n x: originX = circleAttribute.x,\n y: originY = circleAttribute.y,\n fillStrokeOrder = circleAttribute.fillStrokeOrder\n } = circle.attribute;\n\n const data = this.valid(circle, circleAttribute, fillCb, strokeCb);\n if (!data) {\n return;\n }\n const { fVisible, sVisible, doFill, doStroke } = data;\n\n context.beginPath();\n context.arc(x, y, radius, startAngle, endAngle);\n context.closePath();\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(circle, circle.attribute, circleAttribute);\n\n this.beforeRenderStep(\n circle,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n circleAttribute,\n drawContext,\n fillCb,\n strokeCb\n );\n\n const _runFill = () => {\n if (doFill) {\n if (fillCb) {\n fillCb(context, circle.attribute, circleAttribute);\n } else if (fVisible) {\n context.setCommonStyle(circle, circle.attribute, originX - x, originY - y, circleAttribute);\n context.fill();\n }\n }\n };\n\n const _runStroke = () => {\n if (doStroke) {\n if (strokeCb) {\n strokeCb(context, circle.attribute, circleAttribute);\n } else if (sVisible) {\n context.setStrokeStyle(circle, circle.attribute, originX - x, originY - y, circleAttribute);\n context.stroke();\n }\n }\n };\n\n if (!fillStrokeOrder) {\n _runFill();\n _runStroke();\n } else {\n _runStroke();\n _runFill();\n }\n\n this.afterRenderStep(\n circle,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n circleAttribute,\n drawContext,\n fillCb,\n strokeCb\n );\n }\n\n draw(circle: ICircle, renderService: IRenderService, drawContext: IDrawContext, params?: IGraphicRenderDrawParams) {\n const circleAttribute = getTheme(circle, params?.theme).circle;\n this._draw(circle, circleAttribute, false, drawContext, params);\n }\n}\n"]}
|
|
@@ -16,6 +16,7 @@ export declare class DefaultDrawContribution implements IDrawContribution {
|
|
|
16
16
|
layerService: ILayerService;
|
|
17
17
|
scrollMatrix?: IMatrix;
|
|
18
18
|
constructor(contributions: IGraphicRender[], drawItemInterceptorContributions: IContributionProvider<IDrawItemInterceptorContribution>);
|
|
19
|
+
reInit(): void;
|
|
19
20
|
init(): void;
|
|
20
21
|
prepareForDraw(renderService: IRenderService, drawContext: IDrawContext): void;
|
|
21
22
|
draw(renderService: IRenderService, drawContext: IDrawContext): MaybePromise<void>;
|
|
@@ -42,6 +42,11 @@ let DefaultDrawContribution = class {
|
|
|
42
42
|
this.layerService = application.layerService, isArray(this.contributions) || (this.contributions = [ this.contributions ]),
|
|
43
43
|
this.init();
|
|
44
44
|
}
|
|
45
|
+
reInit() {
|
|
46
|
+
this.init(), this.contributions.forEach((item => {
|
|
47
|
+
item.reInit();
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
45
50
|
init() {
|
|
46
51
|
this.contributions.forEach((item => {
|
|
47
52
|
if (item.style) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/render/contributions/render/draw-contribution.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAexF,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEhE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC9F,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAM5C,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAgBlC,YAIiD,aAA+B,EAK3D,gCAAyF;QAL7D,kBAAa,GAAb,aAAa,CAAkB;QAK3D,qCAAgC,GAAhC,gCAAgC,CAAyD;QAE5G,IAAI,CAAC,gBAAgB,GAAG,IAAI,GAAG,EAAE,CAAC;QAClC,IAAI,CAAC,gBAAgB,GAAG,IAAI,GAAG,EAAE,CAAC;QAClC,IAAI,CAAC,cAAc,GAAG,IAAI,GAAG,EAAE,CAAC;QAChC,IAAI,CAA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E;oBAC9C,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;iBAClD;aACF;iBAAM;gBACL,OAAO,CAAC,SAAS,GAAG,WAAW,CAC7B,OAAO,EACP,KAAK,EACL;oBACE,UAAU,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,KAAK,EAAE,EAAE,EAAE,CAAC,GAAG,MAAM,EAAE;iBAC5D,EACD,CAAC,EACD,CAAC,CACF,CAAC;gBACF,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;aACvC;SACF;IACH,CAAC;IAED,SAAS,CAAC,aAA6B,EAAE,UAAwB;QAC/D,OAAO;IACT,CAAC;CACF,CAAA;AAnbY,uBAAuB;IADnC,UAAU,EAAE;IAqBR,WAAA,WAAW,CAAC,aAAa,CAAC,CAAA;IAG1B,WAAA,MAAM,CAAC,oBAAoB,CAAC,CAAA;IAC5B,WAAA,KAAK,CAAC,mBAAmB,CAAC,CAAA;;GAxBlB,uBAAuB,CAmbnC;SAnbY,uBAAuB","file":"draw-contribution.js","sourcesContent":["import { injectable, inject, named, multiInject } from '../../../common/inversify-lite';\nimport type {\n IContext2d,\n MaybePromise,\n IGraphic,\n IGroup,\n IDrawContext,\n IRenderService,\n IGraphicRender,\n IGraphicRenderDrawParams,\n IContributionProvider,\n IDrawItemInterceptorContribution,\n IDrawContribution,\n IGlobal\n} from '../../../interface';\nimport { findNextGraphic, foreach } from '../../../common/sort';\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport { ContributionProvider } from '../../../common/contribution-provider';\nimport { DefaultAttribute } from '../../../graphic/config';\nimport type { IAABBBounds, IBounds, IMatrix } from '@visactor/vutils';\nimport { Bounds, Logger, getRectIntersect, isArray, isRectIntersect } from '@visactor/vutils';\nimport { container } from '../../../container';\nimport { GraphicRender, IncrementalDrawContribution } from './symbol';\nimport { DrawItemInterceptor } from './draw-interceptor';\nimport { createColor } from '../../../common/canvas-utils';\nimport type { ILayerService } from '../../../interface/core';\nimport { boundsAllocate } from '../../../allocator/bounds-allocate';\nimport { matrixAllocate } from '../../../allocator/matrix-allocate';\nimport { application } from '../../../application';\n\n/**\n * 默认的渲染contribution,基于树状结构针对图元的渲染\n */\n@injectable()\nexport class DefaultDrawContribution implements IDrawContribution {\n declare currentRenderMap: Map<number, IGraphicRender>;\n declare defaultRenderMap: Map<number, IGraphicRender>;\n declare styleRenderMap: Map<string, Map<number, IGraphicRender>>;\n declare dirtyBounds: IBounds;\n declare backupDirtyBounds: IBounds;\n // 是否使用dirtyBounds\n declare useDirtyBounds: boolean;\n declare currentRenderService: IRenderService;\n declare InterceptorContributions: IDrawItemInterceptorContribution[];\n\n declare global: IGlobal;\n declare layerService: ILayerService;\n\n declare scrollMatrix?: IMatrix;\n\n constructor(\n // @inject(ContributionProvider)\n // @named(GraphicRender)\n // protected readonly contributions: ContributionProvider<IGraphicRender>,\n @multiInject(GraphicRender) protected readonly contributions: IGraphicRender[],\n // @inject(RenderSelector) protected readonly renderSelector: IRenderSelector, // 根据图元类型选择对应的renderItem进行渲染\n // 拦截器\n @inject(ContributionProvider)\n @named(DrawItemInterceptor)\n protected readonly drawItemInterceptorContributions: IContributionProvider<IDrawItemInterceptorContribution>\n ) {\n this.currentRenderMap = new Map();\n this.defaultRenderMap = new Map();\n this.styleRenderMap = new Map();\n this.dirtyBounds = new Bounds();\n this.backupDirtyBounds = new Bounds();\n this.global = application.global;\n this.layerService = application.layerService;\n if (!isArray(this.contributions)) {\n this.contributions = [this.contributions];\n }\n this.init();\n }\n\n init() {\n this.contributions.forEach(item => {\n if (item.style) {\n const map = this.styleRenderMap.get(item.style) || new Map();\n map.set(item.numberType, item);\n this.styleRenderMap.set(item.style, map);\n } else {\n this.defaultRenderMap.set(item.numberType, item);\n }\n });\n this.InterceptorContributions = this.drawItemInterceptorContributions\n .getContributions()\n .sort((a, b) => a.order - b.order);\n }\n\n prepareForDraw(renderService: IRenderService, drawContext: IDrawContext) {\n // 有dirtyBounds用dirtyBounds\n if (drawContext.updateBounds) {\n this.useDirtyBounds = true;\n } else {\n // 没有的话,看看是否需要跳过outRange的渲染\n this.useDirtyBounds = !drawContext.stage.params.optimize.disableCheckGraphicWidthOutRange;\n }\n }\n\n draw(renderService: IRenderService, drawContext: IDrawContext): MaybePromise<void> {\n this.prepareForDraw(renderService, drawContext);\n drawContext.drawContribution = this;\n this.currentRenderMap = this.styleRenderMap.get(drawContext.renderStyle) || this.defaultRenderMap;\n // this.startAtId = drawParams.startAtId;\n this.currentRenderService = renderService;\n // this.drawParams = drawParams;\n const { context, stage, viewBox, transMatrix } = drawContext;\n\n if (!context) {\n return;\n }\n // if (context.drawPromise) {\n // return;\n // }\n const dirtyBounds: IBounds | undefined = this.dirtyBounds.setValue(0, 0, viewBox.width(), viewBox.height());\n if (stage.dirtyBounds && !stage.dirtyBounds.empty()) {\n const b = getRectIntersect(dirtyBounds, stage.dirtyBounds, false);\n dirtyBounds.x1 = Math.floor(b.x1);\n dirtyBounds.y1 = Math.floor(b.y1);\n dirtyBounds.x2 = Math.ceil(b.x2);\n dirtyBounds.y2 = Math.ceil(b.y2);\n }\n // 如果dpr不是整数或者.5的小数,需要格式化dirtyBounds\n const d = context.dpr % 1;\n if (d || d !== 0.5) {\n dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr;\n dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr;\n dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr;\n dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr;\n }\n this.backupDirtyBounds.copy(dirtyBounds);\n context.inuse = true;\n context.setClearMatrix(transMatrix.a, transMatrix.b, transMatrix.c, transMatrix.d, transMatrix.e, transMatrix.f);\n // 初始化context\n context.clearMatrix();\n context.setTransformForCurrent(true);\n\n // const drawInArea =\n // dirtyBounds.width() * context.dpr < context.canvas.width ||\n // dirtyBounds.height() * context.dpr < context.canvas.height;\n // context.save();\n\n // 设置translate\n context.translate(viewBox.x1, viewBox.y1, true);\n context.beginPath();\n context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height());\n context.clip();\n\n // 如果存在3d视角,那么不使用dirtyBounds\n if (stage.camera) {\n this.dirtyBounds.setValue(-Infinity, -Infinity, Infinity, Infinity);\n this.backupDirtyBounds.setValue(-Infinity, -Infinity, Infinity, Infinity);\n }\n\n this.clearScreen(renderService, context, drawContext);\n // // 渲染的时候图元的起始位置就是x,y\n // this.backupDirtyBounds.translate(-x, -y);\n // this.dirtyBounds.translate(-x, -y);\n\n // // 设置translate\n // context.translate(x, y, true);\n\n context.save();\n renderService.renderTreeRoots\n .sort((a, b) => {\n return (a.attribute.zIndex ?? DefaultAttribute.zIndex) - (b.attribute.zIndex ?? DefaultAttribute.zIndex);\n })\n .forEach(group => {\n group.isContainer\n ? this.renderGroup(group as IGroup, drawContext, matrixAllocate.allocate(1, 0, 0, 1, 0, 0))\n : this.renderItem(group as IGraphic, drawContext);\n });\n\n // context.restore();\n context.restore();\n context.setClearMatrix(1, 0, 0, 1, 0, 0);\n // this.break = false;\n context.inuse = false;\n context.draw();\n }\n\n doRegister() {\n throw new Error('暂不支持');\n }\n\n // 找到下一个graphic\n protected _findNextGraphic(group: IGroup): IGraphic | null {\n let parent = group.parent;\n let id = group._uid;\n while (parent) {\n const g = findNextGraphic(parent, id, DefaultAttribute.zIndex);\n if (g) {\n return g;\n }\n id = parent._uid;\n parent = parent.parent;\n }\n return null;\n }\n\n renderGroup(group: IGroup, drawContext: IDrawContext, parentMatrix: IMatrix, skipSort?: boolean) {\n if (drawContext.break || group.attribute.visibleAll === false) {\n return;\n }\n if (group.incremental && (drawContext.startAtId == null || drawContext.startAtId === group._uid)) {\n drawContext.break = true;\n this._increaseRender(group, drawContext);\n return;\n }\n\n if (\n this.useDirtyBounds &&\n !isRectIntersect(group.AABBBounds, this.dirtyBounds, false) &&\n group.attribute.boundsMode !== 'empty'\n ) {\n return;\n }\n\n let nextM: IMatrix = parentMatrix;\n let tempBounds: IBounds;\n\n if (this.useDirtyBounds) {\n tempBounds = boundsAllocate.allocateByObj(this.dirtyBounds);\n // 变换dirtyBounds\n const gm = group.transMatrix;\n nextM = matrixAllocate.allocateByObj(parentMatrix).multiply(gm.a, gm.b, gm.c, gm.d, gm.e, gm.f);\n // const m = group.globalTransMatrix.getInverse();\n this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(nextM.getInverse());\n }\n\n this.renderItem(group, drawContext, {\n drawingCb: () => {\n skipSort\n ? group.forEachChildren((item: IGraphic) => {\n if (drawContext.break) {\n return;\n }\n if (item.isContainer) {\n this.renderGroup(item as IGroup, drawContext, nextM);\n } else {\n this.renderItem(item, drawContext);\n }\n })\n : foreach(\n group,\n DefaultAttribute.zIndex,\n (item: IGraphic) => {\n if (drawContext.break) {\n return;\n }\n if (item.isContainer) {\n this.renderGroup(item as IGroup, drawContext, nextM);\n } else {\n this.renderItem(item, drawContext);\n }\n },\n false,\n !!drawContext.context?.camera\n );\n }\n });\n\n if (this.useDirtyBounds) {\n this.dirtyBounds.copy(tempBounds);\n boundsAllocate.free(tempBounds);\n matrixAllocate.free(nextM);\n }\n }\n\n protected _increaseRender(group: IGroup, drawContext: IDrawContext) {\n const { layer, stage } = drawContext;\n const { subLayers } = layer;\n // 获取渐进渲染层\n let incrementalLayer = subLayers.get(group._uid);\n if (!incrementalLayer) {\n incrementalLayer = {\n layer: this.layerService.createLayer(stage),\n zIndex: subLayers.size,\n group\n };\n subLayers.set(group._uid, incrementalLayer);\n }\n // 渲染\n const incrementalContext = incrementalLayer.layer.getNativeHandler().getContext();\n const idc = incrementalLayer.drawContribution || container.get(IncrementalDrawContribution);\n idc.dirtyBounds.setValue(-Infinity, -Infinity, Infinity, Infinity);\n idc.backupDirtyBounds.setValue(-Infinity, -Infinity, Infinity, Infinity);\n (idc as any).draw(this.currentRenderService, {\n ...drawContext,\n drawContribution: idc,\n clear: 'transparent',\n layer: incrementalLayer.layer,\n context: incrementalContext,\n startAtId: group._uid,\n break: false\n });\n incrementalLayer.drawContribution = idc;\n // this.draw(this.currentRenderService, {...this.drawParams, startAtId: group._uid})\n // this.draw(this.currentRenderService, {...this.drawParams, clear: 'transparent', layer: incrementalContext.layer, context: incrementalContext, startAtId: group._uid})\n const nextGraphic = this._findNextGraphic(group);\n if (nextGraphic) {\n // 如果是下一个渐进渲染层,那就再来一次\n if (nextGraphic.isContainer && nextGraphic.incremental) {\n this._increaseRender(nextGraphic as IGroup, drawContext);\n } else {\n // 如果不是渐进渲染层,那就默认图层渲染\n let afterLayer = subLayers.get(nextGraphic._uid);\n if (!afterLayer) {\n afterLayer = {\n layer: this.layerService.createLayer(stage),\n zIndex: subLayers.size\n };\n subLayers.set(nextGraphic._uid, afterLayer);\n }\n const afterContext = afterLayer.layer.getNativeHandler().getContext();\n this.draw(this.currentRenderService, {\n ...drawContext,\n drawContribution: idc,\n clear: 'transparent',\n layer: afterLayer.layer,\n context: afterContext,\n startAtId: nextGraphic._uid,\n break: false\n });\n }\n }\n }\n\n getRenderContribution(graphic: IGraphic): IGraphicRender | null {\n let renderer;\n if (!renderer) {\n renderer = this.selectRenderByNumberType(graphic.numberType, graphic);\n }\n if (!renderer) {\n renderer = this.selectRenderByType(graphic.type);\n }\n return renderer;\n }\n\n renderItem(graphic: IGraphic, drawContext: IDrawContext, params?: IGraphicRenderDrawParams) {\n // 添加拦截器\n if (this.InterceptorContributions.length) {\n for (let i = 0; i < this.InterceptorContributions.length; i++) {\n const drawContribution = this.InterceptorContributions[i];\n if (\n drawContribution.beforeDrawItem &&\n drawContribution.beforeDrawItem(graphic, this.currentRenderService, drawContext, this, params)\n ) {\n return;\n }\n }\n }\n\n const renderer = this.getRenderContribution(graphic);\n if (!renderer) {\n return;\n }\n\n let retrans: boolean = this.scrollMatrix && (this.scrollMatrix.e !== 0 || this.scrollMatrix.f !== 0);\n let tempBounds: IBounds;\n\n if (graphic.parent) {\n const { scrollX = 0, scrollY = 0 } = graphic.parent.attribute;\n if (!!(scrollX || scrollY)) {\n retrans = true;\n if (!this.scrollMatrix) {\n this.scrollMatrix = matrixAllocate.allocate(1, 0, 0, 1, 0, 0);\n }\n this.scrollMatrix.translate(-scrollX, -scrollY);\n }\n }\n // 需要二次变化,那就重新算一个变换后的Bounds\n if (retrans) {\n tempBounds = this.dirtyBounds.clone().transformWithMatrix(this.scrollMatrix);\n }\n\n if (\n this.useDirtyBounds &&\n !(\n graphic.isContainer ||\n graphic.attribute.boundsMode === 'empty' ||\n isRectIntersect(graphic.AABBBounds, tempBounds ?? this.dirtyBounds, false)\n )\n ) {\n if (retrans && graphic.parent) {\n const { scrollX = 0, scrollY = 0 } = graphic.parent.attribute;\n this.scrollMatrix && this.scrollMatrix.translate(scrollX, scrollY);\n }\n return;\n }\n\n const skipDraw = drawContext.startAtId != null && graphic._uid !== drawContext.startAtId;\n if (graphic._uid === drawContext.startAtId) {\n drawContext.startAtId = null;\n }\n params && (params.skipDraw = skipDraw);\n if (skipDraw) {\n graphic.isContainer && renderer.draw(graphic, this.currentRenderService, drawContext, params);\n } else {\n renderer.draw(graphic, this.currentRenderService, drawContext, params);\n }\n\n // retrans && this.dirtyBounds.copy(tempBounds);\n if (retrans && graphic.parent) {\n const { scrollX = 0, scrollY = 0 } = graphic.parent.attribute;\n this.scrollMatrix && this.scrollMatrix.translate(scrollX, scrollY);\n }\n\n // 添加拦截器\n if (this.InterceptorContributions.length) {\n for (let i = 0; i < this.InterceptorContributions.length; i++) {\n const drawContribution = this.InterceptorContributions[i];\n if (drawContribution.afterDrawItem) {\n if (drawContribution.afterDrawItem(graphic, this.currentRenderService, drawContext, this)) {\n return;\n }\n }\n }\n }\n }\n // 根据type选择对应的render\n protected selectRenderByType(type?: string): IGraphicRender | null {\n Logger.getInstance().warn('未知错误,不应该走到这里');\n return null;\n }\n // 根据type选择对应的render\n protected selectRenderByNumberType(type: number, graphic: IGraphic): IGraphicRender | null {\n let data;\n if (graphic.attribute.renderStyle) {\n const currentRenderMap = this.styleRenderMap.get(graphic.attribute.renderStyle);\n data = currentRenderMap && currentRenderMap.get(type);\n }\n return data || this.currentRenderMap.get(type) || this.defaultRenderMap.get(type);\n }\n\n protected clearScreen(renderService: IRenderService, context: IContext2d, drawContext: IDrawContext) {\n const { clear, viewBox } = drawContext;\n // 已经translate过了\n const x = 0;\n const y = 0;\n const width = viewBox.width();\n const height = viewBox.height();\n if (clear) {\n context.clearRect(x, y, width, height);\n const stage = renderService.drawParams?.stage;\n stage && (context.globalAlpha = (stage as any).attribute.opacity ?? 1);\n if (stage && (stage as any).backgroundImg && (stage as any).resources) {\n const res = (stage as any).resources.get(clear);\n if (res && res.state === 'success' && res.data) {\n context.drawImage(res.data, x, y, width, height);\n }\n } else {\n context.fillStyle = createColor(\n context,\n clear,\n {\n AABBBounds: { x1: x, y1: y, x2: x + width, y2: y + height }\n },\n 0,\n 0\n );\n context.fillRect(x, y, width, height);\n }\n }\n }\n\n afterDraw(renderService: IRenderService, drawParams: IDrawContext) {\n return;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/render/contributions/render/draw-contribution.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAexF,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEhE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC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D,EACD,CAAC,EACD,CAAC,CACF,CAAC;gBACF,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;aACvC;SACF;IACH,CAAC;IAED,SAAS,CAAC,aAA6B,EAAE,UAAwB;QAC/D,OAAO;IACT,CAAC;CACF,CAAA;AA1bY,uBAAuB;IADnC,UAAU,EAAE;IAqBR,WAAA,WAAW,CAAC,aAAa,CAAC,CAAA;IAG1B,WAAA,MAAM,CAAC,oBAAoB,CAAC,CAAA;IAC5B,WAAA,KAAK,CAAC,mBAAmB,CAAC,CAAA;;GAxBlB,uBAAuB,CA0bnC;SA1bY,uBAAuB","file":"draw-contribution.js","sourcesContent":["import { injectable, inject, named, multiInject } from '../../../common/inversify-lite';\nimport type {\n IContext2d,\n MaybePromise,\n IGraphic,\n IGroup,\n IDrawContext,\n IRenderService,\n IGraphicRender,\n IGraphicRenderDrawParams,\n IContributionProvider,\n IDrawItemInterceptorContribution,\n IDrawContribution,\n IGlobal\n} from '../../../interface';\nimport { findNextGraphic, foreach } from '../../../common/sort';\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport { ContributionProvider } from '../../../common/contribution-provider';\nimport { DefaultAttribute } from '../../../graphic/config';\nimport type { IAABBBounds, IBounds, IMatrix } from '@visactor/vutils';\nimport { Bounds, Logger, getRectIntersect, isArray, isRectIntersect } from '@visactor/vutils';\nimport { container } from '../../../container';\nimport { GraphicRender, IncrementalDrawContribution } from './symbol';\nimport { DrawItemInterceptor } from './draw-interceptor';\nimport { createColor } from '../../../common/canvas-utils';\nimport type { ILayerService } from '../../../interface/core';\nimport { boundsAllocate } from '../../../allocator/bounds-allocate';\nimport { matrixAllocate } from '../../../allocator/matrix-allocate';\nimport { application } from '../../../application';\n\n/**\n * 默认的渲染contribution,基于树状结构针对图元的渲染\n */\n@injectable()\nexport class DefaultDrawContribution implements IDrawContribution {\n declare currentRenderMap: Map<number, IGraphicRender>;\n declare defaultRenderMap: Map<number, IGraphicRender>;\n declare styleRenderMap: Map<string, Map<number, IGraphicRender>>;\n declare dirtyBounds: IBounds;\n declare backupDirtyBounds: IBounds;\n // 是否使用dirtyBounds\n declare useDirtyBounds: boolean;\n declare currentRenderService: IRenderService;\n declare InterceptorContributions: IDrawItemInterceptorContribution[];\n\n declare global: IGlobal;\n declare layerService: ILayerService;\n\n declare scrollMatrix?: IMatrix;\n\n constructor(\n // @inject(ContributionProvider)\n // @named(GraphicRender)\n // protected readonly contributions: ContributionProvider<IGraphicRender>,\n @multiInject(GraphicRender) protected readonly contributions: IGraphicRender[],\n // @inject(RenderSelector) protected readonly renderSelector: IRenderSelector, // 根据图元类型选择对应的renderItem进行渲染\n // 拦截器\n @inject(ContributionProvider)\n @named(DrawItemInterceptor)\n protected readonly drawItemInterceptorContributions: IContributionProvider<IDrawItemInterceptorContribution>\n ) {\n this.currentRenderMap = new Map();\n this.defaultRenderMap = new Map();\n this.styleRenderMap = new Map();\n this.dirtyBounds = new Bounds();\n this.backupDirtyBounds = new Bounds();\n this.global = application.global;\n this.layerService = application.layerService;\n if (!isArray(this.contributions)) {\n this.contributions = [this.contributions];\n }\n this.init();\n }\n\n reInit() {\n this.init();\n this.contributions.forEach(item => {\n item.reInit();\n });\n }\n\n init() {\n this.contributions.forEach(item => {\n if (item.style) {\n const map = this.styleRenderMap.get(item.style) || new Map();\n map.set(item.numberType, item);\n this.styleRenderMap.set(item.style, map);\n } else {\n this.defaultRenderMap.set(item.numberType, item);\n }\n });\n this.InterceptorContributions = this.drawItemInterceptorContributions\n .getContributions()\n .sort((a, b) => a.order - b.order);\n }\n\n prepareForDraw(renderService: IRenderService, drawContext: IDrawContext) {\n // 有dirtyBounds用dirtyBounds\n if (drawContext.updateBounds) {\n this.useDirtyBounds = true;\n } else {\n // 没有的话,看看是否需要跳过outRange的渲染\n this.useDirtyBounds = !drawContext.stage.params.optimize.disableCheckGraphicWidthOutRange;\n }\n }\n\n draw(renderService: IRenderService, drawContext: IDrawContext): MaybePromise<void> {\n this.prepareForDraw(renderService, drawContext);\n drawContext.drawContribution = this;\n this.currentRenderMap = this.styleRenderMap.get(drawContext.renderStyle) || this.defaultRenderMap;\n // this.startAtId = drawParams.startAtId;\n this.currentRenderService = renderService;\n // this.drawParams = drawParams;\n const { context, stage, viewBox, transMatrix } = drawContext;\n\n if (!context) {\n return;\n }\n // if (context.drawPromise) {\n // return;\n // }\n const dirtyBounds: IBounds | undefined = this.dirtyBounds.setValue(0, 0, viewBox.width(), viewBox.height());\n if (stage.dirtyBounds && !stage.dirtyBounds.empty()) {\n const b = getRectIntersect(dirtyBounds, stage.dirtyBounds, false);\n dirtyBounds.x1 = Math.floor(b.x1);\n dirtyBounds.y1 = Math.floor(b.y1);\n dirtyBounds.x2 = Math.ceil(b.x2);\n dirtyBounds.y2 = Math.ceil(b.y2);\n }\n // 如果dpr不是整数或者.5的小数,需要格式化dirtyBounds\n const d = context.dpr % 1;\n if (d || d !== 0.5) {\n dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr;\n dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr;\n dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr;\n dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr;\n }\n this.backupDirtyBounds.copy(dirtyBounds);\n context.inuse = true;\n context.setClearMatrix(transMatrix.a, transMatrix.b, transMatrix.c, transMatrix.d, transMatrix.e, transMatrix.f);\n // 初始化context\n context.clearMatrix();\n context.setTransformForCurrent(true);\n\n // const drawInArea =\n // dirtyBounds.width() * context.dpr < context.canvas.width ||\n // dirtyBounds.height() * context.dpr < context.canvas.height;\n // context.save();\n\n // 设置translate\n context.translate(viewBox.x1, viewBox.y1, true);\n context.beginPath();\n context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height());\n context.clip();\n\n // 如果存在3d视角,那么不使用dirtyBounds\n if (stage.camera) {\n this.dirtyBounds.setValue(-Infinity, -Infinity, Infinity, Infinity);\n this.backupDirtyBounds.setValue(-Infinity, -Infinity, Infinity, Infinity);\n }\n\n this.clearScreen(renderService, context, drawContext);\n // // 渲染的时候图元的起始位置就是x,y\n // this.backupDirtyBounds.translate(-x, -y);\n // this.dirtyBounds.translate(-x, -y);\n\n // // 设置translate\n // context.translate(x, y, true);\n\n context.save();\n renderService.renderTreeRoots\n .sort((a, b) => {\n return (a.attribute.zIndex ?? DefaultAttribute.zIndex) - (b.attribute.zIndex ?? DefaultAttribute.zIndex);\n })\n .forEach(group => {\n group.isContainer\n ? this.renderGroup(group as IGroup, drawContext, matrixAllocate.allocate(1, 0, 0, 1, 0, 0))\n : this.renderItem(group as IGraphic, drawContext);\n });\n\n // context.restore();\n context.restore();\n context.setClearMatrix(1, 0, 0, 1, 0, 0);\n // this.break = false;\n context.inuse = false;\n context.draw();\n }\n\n doRegister() {\n throw new Error('暂不支持');\n }\n\n // 找到下一个graphic\n protected _findNextGraphic(group: IGroup): IGraphic | null {\n let parent = group.parent;\n let id = group._uid;\n while (parent) {\n const g = findNextGraphic(parent, id, DefaultAttribute.zIndex);\n if (g) {\n return g;\n }\n id = parent._uid;\n parent = parent.parent;\n }\n return null;\n }\n\n renderGroup(group: IGroup, drawContext: IDrawContext, parentMatrix: IMatrix, skipSort?: boolean) {\n if (drawContext.break || group.attribute.visibleAll === false) {\n return;\n }\n if (group.incremental && (drawContext.startAtId == null || drawContext.startAtId === group._uid)) {\n drawContext.break = true;\n this._increaseRender(group, drawContext);\n return;\n }\n\n if (\n this.useDirtyBounds &&\n !isRectIntersect(group.AABBBounds, this.dirtyBounds, false) &&\n group.attribute.boundsMode !== 'empty'\n ) {\n return;\n }\n\n let nextM: IMatrix = parentMatrix;\n let tempBounds: IBounds;\n\n if (this.useDirtyBounds) {\n tempBounds = boundsAllocate.allocateByObj(this.dirtyBounds);\n // 变换dirtyBounds\n const gm = group.transMatrix;\n nextM = matrixAllocate.allocateByObj(parentMatrix).multiply(gm.a, gm.b, gm.c, gm.d, gm.e, gm.f);\n // const m = group.globalTransMatrix.getInverse();\n this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(nextM.getInverse());\n }\n\n this.renderItem(group, drawContext, {\n drawingCb: () => {\n skipSort\n ? group.forEachChildren((item: IGraphic) => {\n if (drawContext.break) {\n return;\n }\n if (item.isContainer) {\n this.renderGroup(item as IGroup, drawContext, nextM);\n } else {\n this.renderItem(item, drawContext);\n }\n })\n : foreach(\n group,\n DefaultAttribute.zIndex,\n (item: IGraphic) => {\n if (drawContext.break) {\n return;\n }\n if (item.isContainer) {\n this.renderGroup(item as IGroup, drawContext, nextM);\n } else {\n this.renderItem(item, drawContext);\n }\n },\n false,\n !!drawContext.context?.camera\n );\n }\n });\n\n if (this.useDirtyBounds) {\n this.dirtyBounds.copy(tempBounds);\n boundsAllocate.free(tempBounds);\n matrixAllocate.free(nextM);\n }\n }\n\n protected _increaseRender(group: IGroup, drawContext: IDrawContext) {\n const { layer, stage } = drawContext;\n const { subLayers } = layer;\n // 获取渐进渲染层\n let incrementalLayer = subLayers.get(group._uid);\n if (!incrementalLayer) {\n incrementalLayer = {\n layer: this.layerService.createLayer(stage),\n zIndex: subLayers.size,\n group\n };\n subLayers.set(group._uid, incrementalLayer);\n }\n // 渲染\n const incrementalContext = incrementalLayer.layer.getNativeHandler().getContext();\n const idc = incrementalLayer.drawContribution || container.get(IncrementalDrawContribution);\n idc.dirtyBounds.setValue(-Infinity, -Infinity, Infinity, Infinity);\n idc.backupDirtyBounds.setValue(-Infinity, -Infinity, Infinity, Infinity);\n (idc as any).draw(this.currentRenderService, {\n ...drawContext,\n drawContribution: idc,\n clear: 'transparent',\n layer: incrementalLayer.layer,\n context: incrementalContext,\n startAtId: group._uid,\n break: false\n });\n incrementalLayer.drawContribution = idc;\n // this.draw(this.currentRenderService, {...this.drawParams, startAtId: group._uid})\n // this.draw(this.currentRenderService, {...this.drawParams, clear: 'transparent', layer: incrementalContext.layer, context: incrementalContext, startAtId: group._uid})\n const nextGraphic = this._findNextGraphic(group);\n if (nextGraphic) {\n // 如果是下一个渐进渲染层,那就再来一次\n if (nextGraphic.isContainer && nextGraphic.incremental) {\n this._increaseRender(nextGraphic as IGroup, drawContext);\n } else {\n // 如果不是渐进渲染层,那就默认图层渲染\n let afterLayer = subLayers.get(nextGraphic._uid);\n if (!afterLayer) {\n afterLayer = {\n layer: this.layerService.createLayer(stage),\n zIndex: subLayers.size\n };\n subLayers.set(nextGraphic._uid, afterLayer);\n }\n const afterContext = afterLayer.layer.getNativeHandler().getContext();\n this.draw(this.currentRenderService, {\n ...drawContext,\n drawContribution: idc,\n clear: 'transparent',\n layer: afterLayer.layer,\n context: afterContext,\n startAtId: nextGraphic._uid,\n break: false\n });\n }\n }\n }\n\n getRenderContribution(graphic: IGraphic): IGraphicRender | null {\n let renderer;\n if (!renderer) {\n renderer = this.selectRenderByNumberType(graphic.numberType, graphic);\n }\n if (!renderer) {\n renderer = this.selectRenderByType(graphic.type);\n }\n return renderer;\n }\n\n renderItem(graphic: IGraphic, drawContext: IDrawContext, params?: IGraphicRenderDrawParams) {\n // 添加拦截器\n if (this.InterceptorContributions.length) {\n for (let i = 0; i < this.InterceptorContributions.length; i++) {\n const drawContribution = this.InterceptorContributions[i];\n if (\n drawContribution.beforeDrawItem &&\n drawContribution.beforeDrawItem(graphic, this.currentRenderService, drawContext, this, params)\n ) {\n return;\n }\n }\n }\n\n const renderer = this.getRenderContribution(graphic);\n if (!renderer) {\n return;\n }\n\n let retrans: boolean = this.scrollMatrix && (this.scrollMatrix.e !== 0 || this.scrollMatrix.f !== 0);\n let tempBounds: IBounds;\n\n if (graphic.parent) {\n const { scrollX = 0, scrollY = 0 } = graphic.parent.attribute;\n if (!!(scrollX || scrollY)) {\n retrans = true;\n if (!this.scrollMatrix) {\n this.scrollMatrix = matrixAllocate.allocate(1, 0, 0, 1, 0, 0);\n }\n this.scrollMatrix.translate(-scrollX, -scrollY);\n }\n }\n // 需要二次变化,那就重新算一个变换后的Bounds\n if (retrans) {\n tempBounds = this.dirtyBounds.clone().transformWithMatrix(this.scrollMatrix);\n }\n\n if (\n this.useDirtyBounds &&\n !(\n graphic.isContainer ||\n graphic.attribute.boundsMode === 'empty' ||\n isRectIntersect(graphic.AABBBounds, tempBounds ?? this.dirtyBounds, false)\n )\n ) {\n if (retrans && graphic.parent) {\n const { scrollX = 0, scrollY = 0 } = graphic.parent.attribute;\n this.scrollMatrix && this.scrollMatrix.translate(scrollX, scrollY);\n }\n return;\n }\n\n const skipDraw = drawContext.startAtId != null && graphic._uid !== drawContext.startAtId;\n if (graphic._uid === drawContext.startAtId) {\n drawContext.startAtId = null;\n }\n params && (params.skipDraw = skipDraw);\n if (skipDraw) {\n graphic.isContainer && renderer.draw(graphic, this.currentRenderService, drawContext, params);\n } else {\n renderer.draw(graphic, this.currentRenderService, drawContext, params);\n }\n\n // retrans && this.dirtyBounds.copy(tempBounds);\n if (retrans && graphic.parent) {\n const { scrollX = 0, scrollY = 0 } = graphic.parent.attribute;\n this.scrollMatrix && this.scrollMatrix.translate(scrollX, scrollY);\n }\n\n // 添加拦截器\n if (this.InterceptorContributions.length) {\n for (let i = 0; i < this.InterceptorContributions.length; i++) {\n const drawContribution = this.InterceptorContributions[i];\n if (drawContribution.afterDrawItem) {\n if (drawContribution.afterDrawItem(graphic, this.currentRenderService, drawContext, this)) {\n return;\n }\n }\n }\n }\n }\n // 根据type选择对应的render\n protected selectRenderByType(type?: string): IGraphicRender | null {\n Logger.getInstance().warn('未知错误,不应该走到这里');\n return null;\n }\n // 根据type选择对应的render\n protected selectRenderByNumberType(type: number, graphic: IGraphic): IGraphicRender | null {\n let data;\n if (graphic.attribute.renderStyle) {\n const currentRenderMap = this.styleRenderMap.get(graphic.attribute.renderStyle);\n data = currentRenderMap && currentRenderMap.get(type);\n }\n return data || this.currentRenderMap.get(type) || this.defaultRenderMap.get(type);\n }\n\n protected clearScreen(renderService: IRenderService, context: IContext2d, drawContext: IDrawContext) {\n const { clear, viewBox } = drawContext;\n // 已经translate过了\n const x = 0;\n const y = 0;\n const width = viewBox.width();\n const height = viewBox.height();\n if (clear) {\n context.clearRect(x, y, width, height);\n const stage = renderService.drawParams?.stage;\n stage && (context.globalAlpha = (stage as any).attribute.opacity ?? 1);\n if (stage && (stage as any).backgroundImg && (stage as any).resources) {\n const res = (stage as any).resources.get(clear);\n if (res && res.state === 'success' && res.data) {\n context.drawImage(res.data, x, y, width, height);\n }\n } else {\n context.fillStyle = createColor(\n context,\n clear,\n {\n AABBBounds: { x1: x, y1: y, x2: x + width, y2: y + height }\n },\n 0,\n 0\n );\n context.fillRect(x, y, width, height);\n }\n }\n }\n\n afterDraw(renderService: IRenderService, drawParams: IDrawContext) {\n return;\n }\n}\n"]}
|
|
@@ -2,6 +2,7 @@ import type { IGraphicAttribute, IContext2d, IGlyph, IMarkAttribute, IThemeAttri
|
|
|
2
2
|
export declare class DefaultCanvasGlyphRender implements IGraphicRender {
|
|
3
3
|
type: 'glyph';
|
|
4
4
|
numberType: number;
|
|
5
|
+
reInit(): void;
|
|
5
6
|
drawShape(glyph: IGlyph, context: IContext2d, x: number, y: number, drawContext: IDrawContext, params?: IGraphicRenderDrawParams, fillCb?: (ctx: IContext2d, markAttribute: Partial<IMarkAttribute & IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean, strokeCb?: (ctx: IContext2d, markAttribute: Partial<IMarkAttribute & IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean): void;
|
|
6
7
|
draw(glyph: IGlyph, renderService: IRenderService, drawContext: IDrawContext, params?: IGraphicRenderDrawParams): void;
|
|
7
8
|
}
|
|
@@ -14,6 +14,7 @@ let DefaultCanvasGlyphRender = class {
|
|
|
14
14
|
constructor() {
|
|
15
15
|
this.numberType = GLYPH_NUMBER_TYPE;
|
|
16
16
|
}
|
|
17
|
+
reInit() {}
|
|
17
18
|
drawShape(glyph, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
18
19
|
drawContext.drawContribution && glyph.getSubGraphic().forEach((item => {
|
|
19
20
|
const renderer = drawContext.drawContribution.getRenderContribution(item);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/render/contributions/render/glyph-render.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAcxD,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IAA9B;QAEL,eAAU,GAAW,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"sources":["../src/render/contributions/render/glyph-render.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAcxD,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IAA9B;QAEL,eAAU,GAAW,iBAAiB,CAAC;IAyDzC,CAAC;IArDC,MAAM;QACJ,OAAO;IACT,CAAC;IAED,SAAS,CACP,KAAa,EACb,OAAmB,EACnB,CAAS,EACT,CAAS,EACT,WAAyB,EACzB,MAAiC,EACjC,MAIY,EACZ,QAIY;QAEZ,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE;YACjC,OAAO;SACR;QACD,KAAK,CAAC,aAAa,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACnC,MAAM,QAAQ,GAAG,WAAW,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;YAC1E,IAAI,QAAQ,IAAI,QAAQ,CAAC,SAAS,EAAE;gBAClC,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;aAChF;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,IAAI,CAAC,KAAa,EAAE,aAA6B,EAAE,WAAyB,EAAE,MAAiC;QAC7G,MAAM,EAAE,OAAO,EAAE,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO;SACR;QAED,OAAO,CAAC,mBAAmB,EAAE,CAAC;QAE9B,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE;YACjC,OAAO;SACR;QACD,MAAM,UAAU,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;QACnC,MAAM,UAAU,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC;QACzC,UAAU,CAAC,MAAM;YACf,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;gBACrB,WAAW,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;YACjF,CAAC,CAAC,CAAC;QAEL,OAAO,CAAC,sBAAsB,EAAE,CAAC;IACnC,CAAC;CACF,CAAA;AA3DY,wBAAwB;IADpC,UAAU,EAAE;GACA,wBAAwB,CA2DpC;SA3DY,wBAAwB","file":"glyph-render.js","sourcesContent":["import { injectable } from '../../../common/inversify-lite';\nimport { getTheme } from '../../../graphic/theme';\nimport { GLYPH_NUMBER_TYPE } from '../../../graphic/constants';\nimport type {\n IGraphicAttribute,\n IContext2d,\n IGlyph,\n IMarkAttribute,\n IThemeAttribute,\n IDrawContext,\n IRenderService,\n IGraphicRender,\n IGraphicRenderDrawParams\n} from '../../../interface';\n\n@injectable()\nexport class DefaultCanvasGlyphRender implements IGraphicRender {\n type: 'glyph';\n numberType: number = GLYPH_NUMBER_TYPE;\n\n // constructor() {}\n\n reInit() {\n return;\n }\n\n drawShape(\n glyph: IGlyph,\n context: IContext2d,\n x: number,\n y: number,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n if (!drawContext.drawContribution) {\n return;\n }\n glyph.getSubGraphic().forEach(item => {\n const renderer = drawContext.drawContribution.getRenderContribution(item);\n if (renderer && renderer.drawShape) {\n renderer.drawShape(item, context, x, y, drawContext, params, fillCb, strokeCb);\n }\n });\n }\n\n draw(glyph: IGlyph, renderService: IRenderService, drawContext: IDrawContext, params?: IGraphicRenderDrawParams) {\n const { context } = drawContext;\n if (!context) {\n return;\n }\n\n context.highPerformanceSave();\n\n if (!drawContext.drawContribution) {\n return;\n }\n const glyphTheme = getTheme(glyph);\n const subGraphic = glyph.getSubGraphic();\n subGraphic.length &&\n subGraphic.forEach(g => {\n drawContext.drawContribution.renderItem(g, drawContext, { theme: glyphTheme });\n });\n\n context.highPerformanceRestore();\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/render/contributions/render/graphic-render.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAIrD,IAAe,qBAAqB,GAApC,MAAe,qBAAqB;
|
|
1
|
+
{"version":3,"sources":["../src/render/contributions/render/graphic-render.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAIrD,IAAe,qBAAqB,GAApC,MAAe,qBAAqB;CAO1C,CAAA;AAPqB,qBAAqB;IAD1C,UAAU,EAAE;GACS,qBAAqB,CAO1C;SAPqB,qBAAqB","file":"graphic-render.js","sourcesContent":["import { injectable } from '../../../common/inversify-lite';\nimport type { IGraphic, IGraphicRender, IRenderService } from '../../../interface';\n\n@injectable()\nexport abstract class AbstractGraphicRender implements IGraphicRender {\n type: string; // 图元类型\n numberType: number;\n\n abstract draw(graphic: IGraphic, renderService: IRenderService): void;\n\n abstract reInit(): void;\n}\n"]}
|
|
@@ -5,6 +5,7 @@ export declare class DefaultCanvasGroupRender implements IGraphicRender {
|
|
|
5
5
|
numberType: number;
|
|
6
6
|
_groupRenderContribitions: IGroupRenderContribution[];
|
|
7
7
|
constructor(groupRenderContribitions: IContributionProvider<IGroupRenderContribution>);
|
|
8
|
+
reInit(): void;
|
|
8
9
|
drawShape(group: IGroup, context: IContext2d, x: number, y: number, drawContext: IDrawContext, params?: IGraphicRenderDrawParams, fillCb?: (ctx: IContext2d, markAttribute: Partial<IMarkAttribute & IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean, strokeCb?: (ctx: IContext2d, markAttribute: Partial<IMarkAttribute & IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean): void;
|
|
9
10
|
draw(group: IGroup, renderService: IRenderService, drawContext: IDrawContext, params?: IGraphicRenderDrawParams): void;
|
|
10
11
|
}
|
|
@@ -42,6 +42,10 @@ let DefaultCanvasGroupRender = class {
|
|
|
42
42
|
constructor(groupRenderContribitions) {
|
|
43
43
|
this.groupRenderContribitions = groupRenderContribitions, this.numberType = GROUP_NUMBER_TYPE;
|
|
44
44
|
}
|
|
45
|
+
reInit() {
|
|
46
|
+
this._groupRenderContribitions = this.groupRenderContribitions.getContributions() || [],
|
|
47
|
+
this._groupRenderContribitions.push(defaultGroupBackgroundRenderContribution);
|
|
48
|
+
}
|
|
45
49
|
drawShape(group, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
46
50
|
const groupAttribute = getTheme(group, null == params ? void 0 : params.theme).group, {fill: fill = groupAttribute.fill, background: background, stroke: stroke = groupAttribute.stroke, opacity: opacity = groupAttribute.opacity, width: width = groupAttribute.width, height: height = groupAttribute.height, clip: clip = groupAttribute.clip, fillOpacity: fillOpacity = groupAttribute.fillOpacity, strokeOpacity: strokeOpacity = groupAttribute.strokeOpacity, cornerRadius: cornerRadius = groupAttribute.cornerRadius, path: path = groupAttribute.path, lineWidth: lineWidth = groupAttribute.lineWidth, visible: visible = groupAttribute.visible, fillStrokeOrder: fillStrokeOrder = groupAttribute.fillStrokeOrder, cornerType: cornerType = groupAttribute.cornerType, x: originX = groupAttribute.x, y: originY = groupAttribute.y} = group.attribute, fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill), sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height), doFill = runFill(fill, background), doStroke = runStroke(stroke, lineWidth);
|
|
47
51
|
if (!group.valid || !visible) return;
|