@visactor/vrender-core 1.0.0-alpha.6 → 1.0.0-alpha.8
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/core/stage.d.ts +2 -1
- package/cjs/core/stage.js +4 -3
- package/cjs/core/stage.js.map +1 -1
- package/cjs/graphic/graphic-service/graphic-module.js +1 -2
- package/cjs/graphic/graphic-service/graphic-module.js.map +1 -1
- package/cjs/graphic/graphic.js +7 -4
- package/cjs/graphic/graphic.js.map +1 -1
- package/cjs/graphic/group.js +14 -7
- package/cjs/graphic/group.js.map +1 -1
- package/cjs/interface/stage.d.ts +2 -0
- package/cjs/interface/stage.js.map +1 -1
- package/cjs/plugins/builtin-plugin/auto-render-plugin.js +9 -8
- package/cjs/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js +14 -11
- package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/flex-layout-plugin.js +13 -10
- package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +0 -1
- package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js +8 -5
- package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
- package/cjs/render/contributions/render/draw-contribution.js +1 -1
- package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
- package/dist/index.es.js +95 -59
- package/es/core/stage.d.ts +2 -1
- package/es/core/stage.js +5 -2
- package/es/core/stage.js.map +1 -1
- package/es/graphic/graphic-service/graphic-module.js +1 -1
- package/es/graphic/graphic-service/graphic-module.js.map +1 -1
- package/es/graphic/graphic.js +7 -4
- package/es/graphic/graphic.js.map +1 -1
- package/es/graphic/group.js +15 -8
- package/es/graphic/group.js.map +1 -1
- package/es/interface/stage.d.ts +2 -0
- package/es/interface/stage.js.map +1 -1
- package/es/plugins/builtin-plugin/auto-render-plugin.js +8 -8
- package/es/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/dirty-bounds-plugin.js +13 -12
- package/es/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/flex-layout-plugin.js +12 -11
- package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/html-attribute-plugin.js +0 -1
- package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js +8 -5
- package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
- package/es/render/contributions/render/draw-contribution.js +1 -1
- package/es/render/contributions/render/draw-contribution.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugins/builtin-plugin/incremental-auto-render-plugin.ts"],"names":[],"mappings":";;;AACA,mDAAgD;AAChD,sDAAmD;AAEnD,MAAa,2BAA2B;IAAxC;QACE,SAAI,GAAkC,6BAA6B,CAAC;QACpE,gBAAW,GAAiB,YAAY,CAAC;QAE/B,4BAAuB,GAAgB,IAAI,GAAG,EAAE,CAAC;QACjD,wBAAmB,GAAY,KAAK,CAAC;QAC/C,mBAAc,GAA0B,EAAE,CAAC;QAC3C,SAAI,GAAW,qBAAS,CAAC,kBAAkB,EAAE,CAAC;QAC9C,QAAG,GAAW,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"sources":["../src/plugins/builtin-plugin/incremental-auto-render-plugin.ts"],"names":[],"mappings":";;;AACA,mDAAgD;AAChD,sDAAmD;AAEnD,MAAa,2BAA2B;IAAxC;QACE,SAAI,GAAkC,6BAA6B,CAAC;QACpE,gBAAW,GAAiB,YAAY,CAAC;QAE/B,4BAAuB,GAAgB,IAAI,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OAAO,CAAC,KAAK,CAAC,EAAE;gBAC3C,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;gBAC1B,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,EAAE;oBACpC,OAAO;iBACR;gBACD,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBACvD,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE;oBAC3C,OAAO;iBACR;gBACD,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,kBAChD,KAAK;oBACL,KAAK,EACL,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,EAClC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,mBAAmB,EAAE,EAE/C,KAAK,EAAE,aAAa,EACpB,aAAa,EAAE,KAAK,CAAC,aAAa,EAClC,YAAY,EAAE,KAAK,EACnB,SAAS,EAAE,KAAK,CAAC,IAAI,EACrB,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,UAAU,EAAE,IACpD,IAAI,CAAC,cAAc,EACtB,CAAC;YACL,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;YACzB,IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,CAAC;SACtC;IACH,CAAC;CACF;AAzFD,kEAyFC","file":"incremental-auto-render-plugin.js","sourcesContent":["import type { IGroup, IPlugin, IPluginService, IDrawContext } from '../../interface';\nimport { application } from '../../application';\nimport { Generator } from '../../common/generator';\n\nexport class IncrementalAutoRenderPlugin implements IPlugin {\n name: 'IncrementalAutoRenderPlugin' = 'IncrementalAutoRenderPlugin';\n activeEvent: 'onRegister' = 'onRegister';\n pluginService: IPluginService;\n protected nextFrameRenderGroupSet: Set<IGroup> = new Set();\n protected willNextFrameRender: boolean = false;\n nextUserParams: Partial<IDrawContext> = {};\n _uid: number = Generator.GenAutoIncrementId();\n key: string = this.name + this._uid;\n\n activate(context: IPluginService): void {\n this.pluginService = context;\n const stage = this.pluginService.stage;\n if (!stage) {\n return;\n }\n stage.graphicService.hooks.onAddIncremental.tap(this.key, (graphic, group, stage) => {\n if (graphic.glyphHost) {\n graphic = graphic.glyphHost;\n }\n if (graphic.stage === context.stage && graphic.stage != null) {\n this.nextUserParams.startAtId = group._uid;\n this.renderNextFrame(group);\n }\n });\n stage.graphicService.hooks.onClearIncremental.tap(this.key, (group, stage) => {\n if (group.stage === context.stage && group.stage != null) {\n this.nextUserParams.startAtId = group._uid;\n this.nextUserParams.restartIncremental = true;\n this.renderNextFrame(group);\n }\n });\n }\n deactivate(context: IPluginService): void {\n const stage = this.pluginService.stage;\n if (!stage) {\n return;\n }\n stage.graphicService.hooks.onAddIncremental.taps = stage.graphicService.hooks.onAddIncremental.taps.filter(item => {\n return item.name !== this.key;\n });\n stage.graphicService.hooks.onClearIncremental.taps = stage.graphicService.hooks.onClearIncremental.taps.filter(\n item => {\n return item.name !== this.key;\n }\n );\n }\n\n renderNextFrame(group: IGroup): void {\n this.nextFrameRenderGroupSet.add(group);\n if (!this.willNextFrameRender) {\n this.willNextFrameRender = true;\n application.global.getRequestAnimationFrame()(() => {\n this._doRenderInThisFrame();\n this.willNextFrameRender = false;\n });\n }\n }\n\n _doRenderInThisFrame() {\n const stage = this.pluginService.stage;\n if (this.nextFrameRenderGroupSet.size) {\n this.nextFrameRenderGroupSet.forEach(group => {\n const layer = group.layer;\n if (!layer || !group.layer.subLayers) {\n return;\n }\n const subLayer = group.layer.subLayers.get(group._uid);\n if (!subLayer || !subLayer.drawContribution) {\n return;\n }\n subLayer.drawContribution.draw(stage.renderService, {\n stage,\n layer,\n viewBox: stage.window.getViewBox(),\n transMatrix: stage.window.getViewBoxTransform(),\n // TODO: 多图层时不应该再用默认background\n clear: 'transparent',\n renderService: stage.renderService,\n updateBounds: false,\n startAtId: group._uid,\n context: subLayer.layer.getNativeHandler().getContext(),\n ...this.nextUserParams\n });\n });\n this.nextUserParams = {};\n this.nextFrameRenderGroupSet.clear();\n }\n }\n}\n"]}
|
|
@@ -61,7 +61,7 @@ let DefaultDrawContribution = class {
|
|
|
61
61
|
(d || .5 !== d) && (dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr,
|
|
62
62
|
dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr, dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr,
|
|
63
63
|
dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr), this.backupDirtyBounds.copy(dirtyBounds),
|
|
64
|
-
context.
|
|
64
|
+
context.reset(!1), context.save(), context.setClearMatrix(transMatrix.a, transMatrix.b, transMatrix.c, transMatrix.d, transMatrix.e, transMatrix.f),
|
|
65
65
|
context.clearMatrix(!1), context.translate(viewBox.x1, viewBox.y1, !0), context.beginPath(),
|
|
66
66
|
context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height()),
|
|
67
67
|
context.clip(), stage.camera && (this.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/render/contributions/render/draw-contribution.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mEAAwF;AAexF,+CAAgE;AAEhE,iFAA6E;AAC7E,oDAA2D;AAE3D,6CAA8F;AAC9F,kDAA+C;AAC/C,qCAAsE;AACtE,yDAAyD;AACzD,+DAA2D;AAE3D,wEAAoE;AACpE,wEAAoE;AACpE,sDAAmD;AAM5C,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAgBlC,YAIiD,aAA+B,EAK3D,gCAAyF;QAL7D,kBAAa,GAAb,aAAa,CAAkB;QAK3D,qCAAgC,GAAhC,gCAA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AAM,GAAG,GAAI,KAAa,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;gBAChD,IAAI,GAAG,IAAI,GAAG,CAAC,KAAK,KAAK,SAAS,IAAI,GAAG,CAAC,IAAI,EAAE;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,IAAA,0BAAW,EAC7B,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;AAtcY,uBAAuB;IADnC,IAAA,2BAAU,GAAE;IAqBR,WAAA,IAAA,4BAAW,EAAC,sBAAa,CAAC,CAAA;IAG1B,WAAA,IAAA,uBAAM,EAAC,4CAAoB,CAAC,CAAA;IAC5B,WAAA,IAAA,sBAAK,EAAC,sCAAmB,CAAC,CAAA;;GAxBlB,uBAAuB,CAscnC;AAtcY,0DAAuB","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 // TODO:不需要设置context.transform,后续translate会设置\n context.save();\n context.reset(false);\n context.setClearMatrix(transMatrix.a, transMatrix.b, transMatrix.c, transMatrix.d, transMatrix.e, transMatrix.f);\n // 初始化context\n context.clearMatrix(false);\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.restore();\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 drawContext.isGroupScroll = !!(group.attribute.scrollX || group.attribute.scrollY);\n\n this.renderItem(group, drawContext, {\n renderInGroupParams: {\n skipSort,\n nextM\n },\n renderInGroup: this._renderInGroup\n });\n\n if (this.useDirtyBounds) {\n this.dirtyBounds.copy(tempBounds);\n boundsAllocate.free(tempBounds);\n matrixAllocate.free(nextM);\n }\n }\n\n _renderInGroup = (skipSort: boolean, group: IGroup, drawContext: IDrawContext, nextM: IMatrix) => {\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 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 = false;\n let tempBounds: IBounds;\n\n if (drawContext.isGroupScroll) {\n const { scrollX = 0, scrollY = 0 } = graphic.parent.attribute;\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 // 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,mEAAwF;AAexF,+CAAgE;AAEhE,iFAA6E;AAC7E,oDAA2D;AAE3D,6CAA8F;AAC9F,kDAA+C;AAC/C,qCAAsE;AACtE,yDAAyD;AACzD,+DAA2D;AAE3D,wEAAoE;AACpE,wEAAoE;AACpE,sDAAmD;AAM5C,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAgBlC,YAIiD,aAA+B,EAK3D,gCAAyF;QAL7D,kBAAa,GAAb,aAAa,CAAkB;QAK3D,qCAAgC,GAAhC,gCAAgC,CAAyD;QA+L9G,mBAAc,GAAG,CAAC,QAAiB,EAAE,KAAa,EAAE,WAAyB,EAAE,KAAc,EAAE,EAAE;;YAC/F,QAAQ;gBACN,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,IAAc,EAAE,EAAE;oBACvC,IAAI,WAAW,CAAC,KAAK,EAAE;wBACrB,OAAO;qBACR;oBACD,IAAI,IAAI,CAAC,WAAW,EAAE;wBACpB,IAAI,CAAC,WAAW,CAAC,IAAc,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;qBACtD;yBAAM;wBACL,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;qBACpC;gBACH,CAAC,CAAC;gBACJ,CAAC,CAAC,IAAA,cAAO,EACL,KAAK,EACL,yBAAgB,CAAC,MAAM,EACvB,CAAC,IAAc,EAAE,EAAE;oBACjB,IAAI,WAAW,CAAC,KAAK,EAAE;wBACrB,OAAO;qBACR;oBACD,IAAI,IAAI,CAAC,WAAW,EAAE;wBACpB,IAAI,CAAC,WAAW,CAAC,IAAc,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;qBACtD;yBAAM;wBACL,IAAI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BAAuB;IADnC,IAAA,2BAAU,GAAE;IAqBR,WAAA,IAAA,4BAAW,EAAC,sBAAa,CAAC,CAAA;IAG1B,WAAA,IAAA,uBAAM,EAAC,4CAAoB,CAAC,CAAA;IAC5B,WAAA,IAAA,sBAAK,EAAC,sCAAmB,CAAC,CAAA;;GAxBlB,uBAAuB,CAscnC;AAtcY,0DAAuB","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 // TODO:不需要设置context.transform,后续translate会设置\n context.reset(false);\n context.save();\n context.setClearMatrix(transMatrix.a, transMatrix.b, transMatrix.c, transMatrix.d, transMatrix.e, transMatrix.f);\n // 初始化context\n context.clearMatrix(false);\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.restore();\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 drawContext.isGroupScroll = !!(group.attribute.scrollX || group.attribute.scrollY);\n\n this.renderItem(group, drawContext, {\n renderInGroupParams: {\n skipSort,\n nextM\n },\n renderInGroup: this._renderInGroup\n });\n\n if (this.useDirtyBounds) {\n this.dirtyBounds.copy(tempBounds);\n boundsAllocate.free(tempBounds);\n matrixAllocate.free(nextM);\n }\n }\n\n _renderInGroup = (skipSort: boolean, group: IGroup, drawContext: IDrawContext, nextM: IMatrix) => {\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 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 = false;\n let tempBounds: IBounds;\n\n if (drawContext.isGroupScroll) {\n const { scrollX = 0, scrollY = 0 } = graphic.parent.attribute;\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 // 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"]}
|
package/dist/index.es.js
CHANGED
|
@@ -10949,6 +10949,7 @@ class Graphic extends Node {
|
|
|
10949
10949
|
this._emitCustomEvent('animate-bind', animate);
|
|
10950
10950
|
}
|
|
10951
10951
|
tryUpdateAABBBounds() {
|
|
10952
|
+
var _a, _b;
|
|
10952
10953
|
const full = this.attribute.boundsMode === 'imprecise';
|
|
10953
10954
|
if (!this.shouldUpdateAABBBounds()) {
|
|
10954
10955
|
return this._AABBBounds;
|
|
@@ -10957,9 +10958,9 @@ class Graphic extends Node {
|
|
|
10957
10958
|
this._AABBBounds.clear();
|
|
10958
10959
|
return this._AABBBounds;
|
|
10959
10960
|
}
|
|
10960
|
-
|
|
10961
|
+
(_a = this.stage) === null || _a === void 0 ? void 0 : _a.graphicService.beforeUpdateAABBBounds(this, this.stage, true, this._AABBBounds);
|
|
10961
10962
|
const bounds = this.doUpdateAABBBounds(full);
|
|
10962
|
-
|
|
10963
|
+
(_b = this.stage) === null || _b === void 0 ? void 0 : _b.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, true);
|
|
10963
10964
|
if (this.attribute.boundsMode === 'empty') {
|
|
10964
10965
|
bounds.clear();
|
|
10965
10966
|
}
|
|
@@ -11450,10 +11451,11 @@ class Graphic extends Node {
|
|
|
11450
11451
|
return this;
|
|
11451
11452
|
}
|
|
11452
11453
|
onAttributeUpdate(context) {
|
|
11454
|
+
var _a;
|
|
11453
11455
|
if (context && context.skipUpdateCallback) {
|
|
11454
11456
|
return;
|
|
11455
11457
|
}
|
|
11456
|
-
|
|
11458
|
+
(_a = this.stage) === null || _a === void 0 ? void 0 : _a.graphicService.onAttributeUpdate(this);
|
|
11457
11459
|
this._emitCustomEvent('afterAttributeUpdate', context);
|
|
11458
11460
|
}
|
|
11459
11461
|
update(d) {
|
|
@@ -11745,6 +11747,7 @@ class Graphic extends Node {
|
|
|
11745
11747
|
}
|
|
11746
11748
|
}
|
|
11747
11749
|
setStage(stage, layer) {
|
|
11750
|
+
var _a;
|
|
11748
11751
|
if (this.stage !== stage) {
|
|
11749
11752
|
this.stage = stage;
|
|
11750
11753
|
this.layer = layer;
|
|
@@ -11759,7 +11762,7 @@ class Graphic extends Node {
|
|
|
11759
11762
|
});
|
|
11760
11763
|
}
|
|
11761
11764
|
this._onSetStage && this._onSetStage(this, stage, layer);
|
|
11762
|
-
|
|
11765
|
+
(_a = this.stage) === null || _a === void 0 ? void 0 : _a.graphicService.onSetStage(this, stage);
|
|
11763
11766
|
}
|
|
11764
11767
|
}
|
|
11765
11768
|
setStageToShadowRoot(stage, layer) {
|
|
@@ -12011,14 +12014,15 @@ class Group extends Graphic {
|
|
|
12011
12014
|
return false;
|
|
12012
12015
|
}
|
|
12013
12016
|
tryUpdateAABBBounds() {
|
|
12017
|
+
var _a, _b;
|
|
12014
12018
|
if (!this.shouldUpdateAABBBounds()) {
|
|
12015
12019
|
return this._AABBBounds;
|
|
12016
12020
|
}
|
|
12017
|
-
|
|
12021
|
+
(_a = this.stage) === null || _a === void 0 ? void 0 : _a.graphicService.beforeUpdateAABBBounds(this, this.stage, true, this._AABBBounds);
|
|
12018
12022
|
const selfChange = this.shouldSelfChangeUpdateAABBBounds();
|
|
12019
12023
|
const bounds = this.doUpdateAABBBounds();
|
|
12020
12024
|
this.addUpdateLayoutTag();
|
|
12021
|
-
|
|
12025
|
+
(_b = this.stage) === null || _b === void 0 ? void 0 : _b.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, selfChange);
|
|
12022
12026
|
if (this.attribute.boundsMode === 'empty') {
|
|
12023
12027
|
bounds.clear();
|
|
12024
12028
|
}
|
|
@@ -12087,19 +12091,21 @@ class Group extends Graphic {
|
|
|
12087
12091
|
return this.theme.getTheme(this);
|
|
12088
12092
|
}
|
|
12089
12093
|
incrementalAppendChild(node) {
|
|
12094
|
+
var _a;
|
|
12090
12095
|
const data = super.appendChild(node);
|
|
12091
12096
|
if (this.stage && data) {
|
|
12092
12097
|
data.stage = this.stage;
|
|
12093
12098
|
data.layer = this.layer;
|
|
12094
12099
|
}
|
|
12095
12100
|
this.addUpdateBoundTag();
|
|
12096
|
-
|
|
12101
|
+
(_a = this.stage) === null || _a === void 0 ? void 0 : _a.graphicService.onAddIncremental(node, this, this.stage);
|
|
12097
12102
|
return data;
|
|
12098
12103
|
}
|
|
12099
12104
|
incrementalClearChild() {
|
|
12105
|
+
var _a;
|
|
12100
12106
|
super.removeAllChild();
|
|
12101
12107
|
this.addUpdateBoundTag();
|
|
12102
|
-
|
|
12108
|
+
(_a = this.stage) === null || _a === void 0 ? void 0 : _a.graphicService.onClearIncremental(this, this.stage);
|
|
12103
12109
|
return;
|
|
12104
12110
|
}
|
|
12105
12111
|
_updateChildToStage(child) {
|
|
@@ -12127,15 +12133,17 @@ class Group extends Graphic {
|
|
|
12127
12133
|
return this._updateChildToStage(super.insertInto(newNode, idx));
|
|
12128
12134
|
}
|
|
12129
12135
|
removeChild(child) {
|
|
12136
|
+
var _a;
|
|
12130
12137
|
const data = super.removeChild(child);
|
|
12131
12138
|
child.stage = null;
|
|
12132
|
-
|
|
12139
|
+
(_a = this.stage) === null || _a === void 0 ? void 0 : _a.graphicService.onRemove(child);
|
|
12133
12140
|
this.addUpdateBoundTag();
|
|
12134
12141
|
return data;
|
|
12135
12142
|
}
|
|
12136
12143
|
removeAllChild(deep = false) {
|
|
12137
12144
|
this.forEachChildren((child) => {
|
|
12138
|
-
|
|
12145
|
+
var _a;
|
|
12146
|
+
(_a = this.stage) === null || _a === void 0 ? void 0 : _a.graphicService.onRemove(child);
|
|
12139
12147
|
if (deep && child.isContainer) {
|
|
12140
12148
|
child.removeAllChild(deep);
|
|
12141
12149
|
}
|
|
@@ -12144,12 +12152,13 @@ class Group extends Graphic {
|
|
|
12144
12152
|
this.addUpdateBoundTag();
|
|
12145
12153
|
}
|
|
12146
12154
|
setStage(stage, layer) {
|
|
12155
|
+
var _a;
|
|
12147
12156
|
if (this.stage !== stage) {
|
|
12148
12157
|
this.stage = stage;
|
|
12149
12158
|
this.layer = layer;
|
|
12150
12159
|
this.setStageToShadowRoot(stage, layer);
|
|
12151
12160
|
this._onSetStage && this._onSetStage(this, stage, layer);
|
|
12152
|
-
|
|
12161
|
+
(_a = this.stage) === null || _a === void 0 ? void 0 : _a.graphicService.onSetStage(this, stage);
|
|
12153
12162
|
this.forEachChildren(item => {
|
|
12154
12163
|
item.setStage(stage, this.layer);
|
|
12155
12164
|
});
|
|
@@ -21100,7 +21109,7 @@ var pickModule = new ContainerModule((bind, unbind, isBound) => {
|
|
|
21100
21109
|
});
|
|
21101
21110
|
|
|
21102
21111
|
var graphicModule = new ContainerModule(bind => {
|
|
21103
|
-
bind(GraphicService).to(DefaultGraphicService)
|
|
21112
|
+
bind(GraphicService).to(DefaultGraphicService);
|
|
21104
21113
|
bind(GraphicCreator$1).toConstantValue(graphicCreator);
|
|
21105
21114
|
});
|
|
21106
21115
|
|
|
@@ -21508,8 +21517,8 @@ let DefaultDrawContribution = class DefaultDrawContribution {
|
|
|
21508
21517
|
dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr;
|
|
21509
21518
|
}
|
|
21510
21519
|
this.backupDirtyBounds.copy(dirtyBounds);
|
|
21511
|
-
context.save();
|
|
21512
21520
|
context.reset(false);
|
|
21521
|
+
context.save();
|
|
21513
21522
|
context.setClearMatrix(transMatrix.a, transMatrix.b, transMatrix.c, transMatrix.d, transMatrix.e, transMatrix.f);
|
|
21514
21523
|
context.clearMatrix(false);
|
|
21515
21524
|
context.translate(viewBox.x1, viewBox.y1, true);
|
|
@@ -22121,9 +22130,13 @@ class AutoRenderPlugin {
|
|
|
22121
22130
|
}
|
|
22122
22131
|
activate(context) {
|
|
22123
22132
|
this.pluginService = context;
|
|
22124
|
-
|
|
22125
|
-
|
|
22126
|
-
|
|
22133
|
+
const stage = this.pluginService.stage;
|
|
22134
|
+
if (!stage) {
|
|
22135
|
+
return;
|
|
22136
|
+
}
|
|
22137
|
+
stage.graphicService.hooks.onAttributeUpdate.tap(this.key, this.handleChange);
|
|
22138
|
+
stage.graphicService.hooks.onSetStage.tap(this.key, this.handleChange);
|
|
22139
|
+
stage.graphicService.hooks.onRemove.tap(this.key, this.handleChange);
|
|
22127
22140
|
}
|
|
22128
22141
|
deactivate(context) {
|
|
22129
22142
|
const filterByName = (taps) => {
|
|
@@ -22131,9 +22144,13 @@ class AutoRenderPlugin {
|
|
|
22131
22144
|
return item.name !== this.key;
|
|
22132
22145
|
});
|
|
22133
22146
|
};
|
|
22134
|
-
|
|
22135
|
-
|
|
22136
|
-
|
|
22147
|
+
const stage = this.pluginService.stage;
|
|
22148
|
+
if (!stage) {
|
|
22149
|
+
return;
|
|
22150
|
+
}
|
|
22151
|
+
stage.graphicService.hooks.onAttributeUpdate.taps = filterByName(stage.graphicService.hooks.onAttributeUpdate.taps);
|
|
22152
|
+
stage.graphicService.hooks.onSetStage.taps = filterByName(stage.graphicService.hooks.onSetStage.taps);
|
|
22153
|
+
stage.graphicService.hooks.onRemove.taps = filterByName(stage.graphicService.hooks.onRemove.taps);
|
|
22137
22154
|
}
|
|
22138
22155
|
}
|
|
22139
22156
|
|
|
@@ -22218,7 +22235,11 @@ class IncrementalAutoRenderPlugin {
|
|
|
22218
22235
|
}
|
|
22219
22236
|
activate(context) {
|
|
22220
22237
|
this.pluginService = context;
|
|
22221
|
-
|
|
22238
|
+
const stage = this.pluginService.stage;
|
|
22239
|
+
if (!stage) {
|
|
22240
|
+
return;
|
|
22241
|
+
}
|
|
22242
|
+
stage.graphicService.hooks.onAddIncremental.tap(this.key, (graphic, group, stage) => {
|
|
22222
22243
|
if (graphic.glyphHost) {
|
|
22223
22244
|
graphic = graphic.glyphHost;
|
|
22224
22245
|
}
|
|
@@ -22227,7 +22248,7 @@ class IncrementalAutoRenderPlugin {
|
|
|
22227
22248
|
this.renderNextFrame(group);
|
|
22228
22249
|
}
|
|
22229
22250
|
});
|
|
22230
|
-
|
|
22251
|
+
stage.graphicService.hooks.onClearIncremental.tap(this.key, (group, stage) => {
|
|
22231
22252
|
if (group.stage === context.stage && group.stage != null) {
|
|
22232
22253
|
this.nextUserParams.startAtId = group._uid;
|
|
22233
22254
|
this.nextUserParams.restartIncremental = true;
|
|
@@ -22236,14 +22257,16 @@ class IncrementalAutoRenderPlugin {
|
|
|
22236
22257
|
});
|
|
22237
22258
|
}
|
|
22238
22259
|
deactivate(context) {
|
|
22239
|
-
|
|
22240
|
-
|
|
22241
|
-
|
|
22242
|
-
|
|
22243
|
-
|
|
22244
|
-
|
|
22245
|
-
|
|
22246
|
-
|
|
22260
|
+
const stage = this.pluginService.stage;
|
|
22261
|
+
if (!stage) {
|
|
22262
|
+
return;
|
|
22263
|
+
}
|
|
22264
|
+
stage.graphicService.hooks.onAddIncremental.taps = stage.graphicService.hooks.onAddIncremental.taps.filter(item => {
|
|
22265
|
+
return item.name !== this.key;
|
|
22266
|
+
});
|
|
22267
|
+
stage.graphicService.hooks.onClearIncremental.taps = stage.graphicService.hooks.onClearIncremental.taps.filter(item => {
|
|
22268
|
+
return item.name !== this.key;
|
|
22269
|
+
});
|
|
22247
22270
|
}
|
|
22248
22271
|
renderNextFrame(group) {
|
|
22249
22272
|
this.nextFrameRenderGroupSet.add(group);
|
|
@@ -22292,7 +22315,11 @@ class DirtyBoundsPlugin {
|
|
|
22292
22315
|
}
|
|
22293
22316
|
stage.dirtyBounds.clear();
|
|
22294
22317
|
});
|
|
22295
|
-
|
|
22318
|
+
const stage = this.pluginService.stage;
|
|
22319
|
+
if (!stage) {
|
|
22320
|
+
return;
|
|
22321
|
+
}
|
|
22322
|
+
stage.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key, (graphic, stage, willUpdate, bounds) => {
|
|
22296
22323
|
if (graphic.glyphHost) {
|
|
22297
22324
|
graphic = graphic.glyphHost;
|
|
22298
22325
|
}
|
|
@@ -22307,7 +22334,7 @@ class DirtyBoundsPlugin {
|
|
|
22307
22334
|
stage.dirty(globalBounds, graphic.parent && graphic.parent.globalTransMatrix);
|
|
22308
22335
|
}
|
|
22309
22336
|
});
|
|
22310
|
-
|
|
22337
|
+
stage.graphicService.hooks.afterUpdateAABBBounds.tap(this.key, (graphic, stage, bounds, params, selfChange) => {
|
|
22311
22338
|
if (!(stage && stage === this.pluginService.stage && stage.renderCount)) {
|
|
22312
22339
|
return;
|
|
22313
22340
|
}
|
|
@@ -22316,7 +22343,7 @@ class DirtyBoundsPlugin {
|
|
|
22316
22343
|
}
|
|
22317
22344
|
stage.dirty(params.globalAABBBounds);
|
|
22318
22345
|
});
|
|
22319
|
-
|
|
22346
|
+
stage.graphicService.hooks.clearAABBBounds.tap(this.key, (graphic, stage, bounds) => {
|
|
22320
22347
|
if (!(stage && stage === this.pluginService.stage && stage.renderCount)) {
|
|
22321
22348
|
return;
|
|
22322
22349
|
}
|
|
@@ -22324,7 +22351,7 @@ class DirtyBoundsPlugin {
|
|
|
22324
22351
|
stage.dirty(bounds);
|
|
22325
22352
|
}
|
|
22326
22353
|
});
|
|
22327
|
-
|
|
22354
|
+
stage.graphicService.hooks.onRemove.tap(this.key, (graphic) => {
|
|
22328
22355
|
const stage = graphic.stage;
|
|
22329
22356
|
if (!(stage && stage === this.pluginService.stage && stage.renderCount)) {
|
|
22330
22357
|
return;
|
|
@@ -22335,22 +22362,25 @@ class DirtyBoundsPlugin {
|
|
|
22335
22362
|
});
|
|
22336
22363
|
}
|
|
22337
22364
|
deactivate(context) {
|
|
22338
|
-
|
|
22339
|
-
|
|
22340
|
-
|
|
22341
|
-
|
|
22342
|
-
|
|
22343
|
-
|
|
22365
|
+
const stage = this.pluginService.stage;
|
|
22366
|
+
if (!stage) {
|
|
22367
|
+
return;
|
|
22368
|
+
}
|
|
22369
|
+
stage.graphicService.hooks.beforeUpdateAABBBounds.taps =
|
|
22370
|
+
stage.graphicService.hooks.beforeUpdateAABBBounds.taps.filter(item => {
|
|
22344
22371
|
return item.name !== this.key;
|
|
22345
22372
|
});
|
|
22346
|
-
|
|
22347
|
-
|
|
22373
|
+
stage.graphicService.hooks.afterUpdateAABBBounds.taps =
|
|
22374
|
+
stage.graphicService.hooks.afterUpdateAABBBounds.taps.filter(item => {
|
|
22348
22375
|
return item.name !== this.key;
|
|
22349
22376
|
});
|
|
22350
|
-
|
|
22377
|
+
stage.graphicService.hooks.clearAABBBounds.taps = stage.graphicService.hooks.clearAABBBounds.taps.filter(item => {
|
|
22378
|
+
return item.name !== this.key;
|
|
22379
|
+
});
|
|
22380
|
+
stage.hooks.afterRender.taps = stage.hooks.afterRender.taps.filter(item => {
|
|
22351
22381
|
return item.name !== this.key;
|
|
22352
22382
|
});
|
|
22353
|
-
|
|
22383
|
+
stage.graphicService.hooks.onRemove.taps = stage.graphicService.hooks.onRemove.taps.filter(item => {
|
|
22354
22384
|
return item.name !== this.key;
|
|
22355
22385
|
});
|
|
22356
22386
|
}
|
|
@@ -22538,6 +22568,7 @@ class Stage extends Group {
|
|
|
22538
22568
|
this.renderService = container.get(RenderService);
|
|
22539
22569
|
this.pluginService = container.get(PluginService);
|
|
22540
22570
|
this.layerService = container.get(LayerService);
|
|
22571
|
+
this.graphicService = container.get(GraphicService);
|
|
22541
22572
|
this.pluginService.active(this, params);
|
|
22542
22573
|
this.window.create({
|
|
22543
22574
|
width: params.width,
|
|
@@ -22581,7 +22612,7 @@ class Stage extends Group {
|
|
|
22581
22612
|
this.supportInteractiveLayer = params.interactiveLayer !== false;
|
|
22582
22613
|
if (!params.optimize) {
|
|
22583
22614
|
params.optimize = {
|
|
22584
|
-
tickRenderMode: '
|
|
22615
|
+
tickRenderMode: 'effect'
|
|
22585
22616
|
};
|
|
22586
22617
|
}
|
|
22587
22618
|
this.optmize(params.optimize);
|
|
@@ -26845,8 +26876,6 @@ class HtmlAttributePlugin {
|
|
|
26845
26876
|
context.stage.hooks.afterRender.taps = context.stage.hooks.afterRender.taps.filter(item => {
|
|
26846
26877
|
return item.name !== this.key;
|
|
26847
26878
|
});
|
|
26848
|
-
application.graphicService.hooks.onRemove.unTap(this.key);
|
|
26849
|
-
application.graphicService.hooks.onRelease.unTap(this.key);
|
|
26850
26879
|
this.release();
|
|
26851
26880
|
}
|
|
26852
26881
|
getWrapContainer(stage, userContainer, domParams) {
|
|
@@ -27590,7 +27619,11 @@ class FlexLayoutPlugin {
|
|
|
27590
27619
|
}
|
|
27591
27620
|
activate(context) {
|
|
27592
27621
|
this.pluginService = context;
|
|
27593
|
-
|
|
27622
|
+
const stage = this.pluginService.stage;
|
|
27623
|
+
if (!stage) {
|
|
27624
|
+
return;
|
|
27625
|
+
}
|
|
27626
|
+
stage.graphicService.hooks.onAttributeUpdate.tap(this.key, graphic => {
|
|
27594
27627
|
if (graphic.glyphHost) {
|
|
27595
27628
|
graphic = graphic.glyphHost;
|
|
27596
27629
|
}
|
|
@@ -27599,7 +27632,7 @@ class FlexLayoutPlugin {
|
|
|
27599
27632
|
}
|
|
27600
27633
|
this.tryLayout(graphic, false);
|
|
27601
27634
|
});
|
|
27602
|
-
|
|
27635
|
+
stage.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key, (graphic, stage, willUpdate, bounds) => {
|
|
27603
27636
|
if (graphic.glyphHost) {
|
|
27604
27637
|
graphic = graphic.glyphHost;
|
|
27605
27638
|
}
|
|
@@ -27611,7 +27644,7 @@ class FlexLayoutPlugin {
|
|
|
27611
27644
|
}
|
|
27612
27645
|
_tempBounds.copy(bounds);
|
|
27613
27646
|
});
|
|
27614
|
-
|
|
27647
|
+
stage.graphicService.hooks.afterUpdateAABBBounds.tap(this.key, (graphic, stage, bounds, params, selfChange) => {
|
|
27615
27648
|
if (!(stage && stage === this.pluginService.stage)) {
|
|
27616
27649
|
return;
|
|
27617
27650
|
}
|
|
@@ -27622,7 +27655,7 @@ class FlexLayoutPlugin {
|
|
|
27622
27655
|
this.tryLayout(graphic, false);
|
|
27623
27656
|
}
|
|
27624
27657
|
});
|
|
27625
|
-
|
|
27658
|
+
stage.graphicService.hooks.onSetStage.tap(this.key, graphic => {
|
|
27626
27659
|
if (graphic.glyphHost) {
|
|
27627
27660
|
graphic = graphic.glyphHost;
|
|
27628
27661
|
}
|
|
@@ -27630,19 +27663,22 @@ class FlexLayoutPlugin {
|
|
|
27630
27663
|
});
|
|
27631
27664
|
}
|
|
27632
27665
|
deactivate(context) {
|
|
27633
|
-
|
|
27634
|
-
|
|
27635
|
-
|
|
27636
|
-
|
|
27637
|
-
|
|
27638
|
-
|
|
27666
|
+
const stage = this.pluginService.stage;
|
|
27667
|
+
if (!stage) {
|
|
27668
|
+
return;
|
|
27669
|
+
}
|
|
27670
|
+
stage.graphicService.hooks.onAttributeUpdate.taps = stage.graphicService.hooks.onAttributeUpdate.taps.filter(item => {
|
|
27671
|
+
return item.name !== this.key;
|
|
27672
|
+
});
|
|
27673
|
+
stage.graphicService.hooks.beforeUpdateAABBBounds.taps =
|
|
27674
|
+
stage.graphicService.hooks.beforeUpdateAABBBounds.taps.filter(item => {
|
|
27639
27675
|
return item.name !== this.key;
|
|
27640
27676
|
});
|
|
27641
|
-
|
|
27642
|
-
|
|
27677
|
+
stage.graphicService.hooks.afterUpdateAABBBounds.taps =
|
|
27678
|
+
stage.graphicService.hooks.afterUpdateAABBBounds.taps.filter(item => {
|
|
27643
27679
|
return item.name !== this.key;
|
|
27644
27680
|
});
|
|
27645
|
-
|
|
27681
|
+
stage.graphicService.hooks.onSetStage.taps = stage.graphicService.hooks.onSetStage.taps.filter(item => {
|
|
27646
27682
|
return item.name !== this.key;
|
|
27647
27683
|
});
|
|
27648
27684
|
}
|
package/es/core/stage.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IAABBBounds, IBounds, IBoundsLike, IMatrix } from '@visactor/vutils';
|
|
2
|
-
import type { IExportType, IStage, IStageParams, ILayer, IColor, IOption3D, ICamera, vec3, IDirectionLight, ITicker, IRenderService, IPickerService, IPluginService, ISyncHook, IDrawContext, IWindow, ILayerService, ITimeline, IOptimizeType, LayerMode, PickResult, IPlugin } from '../interface';
|
|
2
|
+
import type { IExportType, IStage, IStageParams, ILayer, IColor, IOption3D, ICamera, vec3, IDirectionLight, ITicker, IRenderService, IPickerService, IPluginService, ISyncHook, IDrawContext, IWindow, ILayerService, ITimeline, IOptimizeType, LayerMode, PickResult, IPlugin, IGraphicService } from '../interface';
|
|
3
3
|
import type { Layer } from './layer';
|
|
4
4
|
import { Group } from '../graphic/group';
|
|
5
5
|
type IStageState = 'rendering' | 'normal';
|
|
@@ -53,6 +53,7 @@ export declare class Stage extends Group implements IStage {
|
|
|
53
53
|
protected pickerService?: IPickerService;
|
|
54
54
|
readonly pluginService: IPluginService;
|
|
55
55
|
readonly layerService: ILayerService;
|
|
56
|
+
readonly graphicService: IGraphicService;
|
|
56
57
|
private _eventSystem?;
|
|
57
58
|
private get eventSystem();
|
|
58
59
|
protected _beforeRender?: (stage: IStage) => void;
|