@visactor/vrender 0.11.1-alpha.1 → 0.11.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.
@@ -92,7 +92,6 @@ export class EventSystem {
92
92
  this.supportsTouchEvents && (domElement.addEventListener("touchstart", this.onPointerDown, !0),
93
93
  domElement.addEventListener("touchend", this.onPointerUp, !0), domElement.addEventListener("touchmove", this.onPointerMove, !0)),
94
94
  domElement.addEventListener("wheel", this.onWheel, {
95
- passive: !0,
96
95
  capture: !0
97
96
  }), this.eventsAdded = !0;
98
97
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/event/event-system.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,QAAQ,EAAc,MAAM,kBAAkB,CAAC;AAE1E,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAI/E,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE/B,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAC3B,MAAM,gBAAgB,GAA2B;IAC/C,UAAU,EAAE,aAAa;IACzB,QAAQ,EAAE,WAAW;IACrB,eAAe,EAAE,kBAAkB;IACnC,SAAS,EAAE,aAAa;IACxB,WAAW,EAAE,eAAe;CAC7B,CAAC;AA8BF,MAAM,OAAO,WAAW;IAiDtB,YAAY,MAAoB;QAPhC,eAAU,GAAG,CAAC,CAAC;QA2DP,kBAAa,GAAG,CAAC,WAAwB,EAAQ,EAAE;YACzD,IAAI,IAAI,CAAC,mBAAmB,IAAK,WAA4B,CAAC,WAAW,KAAK,OAAO,EAAE;gBACrF,OAAO;aACR;YAED,MAAM,MAAM,GAAG,IAAI,CAAC,sBAAsB,CAAC,WAAW,CAAC,CAAC;YAExD,IAAI,IAAI,CAAC,kBAAkB,IAAK,MAAM,CAAC,CAAC,CAAS,C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AAO,CAAC;QACpC,KAAK,CAAC,QAAQ,CAAC,CAAC,GAAG,WAAW,CAAC,SAAS,CAAC;QACzC,KAAK,CAAC,QAAQ,CAAC,CAAC,GAAG,WAAW,CAAC,SAAS,CAAC;QACzC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC;QACjC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC;QACjC,KAAK,CAAC,aAAa,GAAG,IAAI,CAAC;IAC7B,CAAC;IAEO,6BAA6B,CAAC,WAAwB;QAC5D,IAAI,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC;QAEhC,IAAI,WAAW,CAAC,YAAY,IAAI,WAAW,CAAC,YAAY,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE;YACrE,MAAM,GAAG,WAAW,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC;SACxC;QAED,MAAM,aAAa,GAAG,IAAI,CAAC,UAAU,CAAC,gBAAgB;YACpD,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC,YAAY;YACjD,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC;QAEpB,OAAO,MAAM,KAAK,aAAa,CAAC;IAClC,CAAC;CACF","file":"event-system.js","sourcesContent":["import { isUndefined, has, isString, IPointLike } from '@visactor/vutils';\nimport { IGlobal } from '../interface';\nimport { EventManager } from './event-manager';\nimport { FederatedPointerEvent, FederatedWheelEvent } from './federated-event';\nimport type { FederatedMouseEvent } from './federated-event/mouse-event';\nimport type { IEventTarget } from './interface';\nimport type { IElementLike, NativeEvent, RenderConfig } from './type';\nimport { clock } from './util';\n\nconst MOUSE_POINTER_ID = 1;\nconst TOUCH_TO_POINTER: Record<string, string> = {\n touchstart: 'pointerdown',\n touchend: 'pointerup',\n touchendoutside: 'pointerupoutside',\n touchmove: 'pointermove',\n touchcancel: 'pointercancel'\n};\n\n/**\n * 代码参考自 https://github.com/pixijs/pixijs\n * The MIT License\n\n Copyright (c) 2013-2023 Mathew Groves, Chad Engler\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n */\n\n/**\n * The system for handling UI events.\n */\nexport class EventSystem {\n private readonly globalObj: IGlobal;\n readonly manager: EventManager;\n\n /** Does the device support touch events https://www.w3.org/TR/touch-events/ */\n // readonly supportsTouchEvents = 'ontouchstart' in this.globalObj;\n readonly supportsTouchEvents: boolean;\n\n /** Does the device support pointer events https://www.w3.org/Submission/pointer-events/ */\n // readonly supportsPointerEvents = !!this.globalObj.PointerEvent;\n readonly supportsPointerEvents: boolean;\n\n readonly supportsMouseEvents: boolean;\n\n readonly applyStyles: boolean;\n\n readonly viewport: RenderConfig['viewport'];\n\n /**\n * Should default browser actions automatically be prevented.\n * Does not apply to pointer events for backwards compatibility\n * preventDefault on pointer events stops mouse events from firing\n * Thus, for every pointer event, there will always be either a mouse of touch event alongside it.\n * @default false\n */\n autoPreventDefault: boolean;\n\n /**\n * Dictionary of how different cursor modes are handled. Strings are handled as CSS cursor\n * values, objects are handled as dictionaries of CSS values for domElement,\n * and functions are called instead of changing the CSS.\n * Default CSS cursor values are provided for 'default' and 'pointer' modes.\n * @member {Object<string, string | ((mode: string) => void) | CSSStyleDeclaration>}\n */\n cursorStyles: Record<string, string | ((mode: string) => void) | CSSStyleDeclaration>;\n\n /**\n * The DOM element to which the root event listeners are bound. This is automatically set to\n */\n domElement: IElementLike | null;\n\n /** The resolution used to convert between the DOM client space into world space. */\n resolution = 1;\n\n private currentCursor: string;\n private rootPointerEvent: FederatedPointerEvent;\n private rootWheelEvent: FederatedWheelEvent;\n private eventsAdded: boolean;\n\n constructor(params: RenderConfig) {\n const { targetElement, resolution, rootNode, global, viewport, autoPreventDefault = false } = params;\n this.manager = new EventManager(rootNode);\n\n this.globalObj = global;\n this.supportsPointerEvents = global.supportsPointerEvents;\n this.supportsTouchEvents = global.supportsTouchEvents;\n this.supportsMouseEvents = global.supportsMouseEvents;\n this.applyStyles = global.applyStyles;\n\n this.autoPreventDefault = autoPreventDefault;\n this.eventsAdded = false;\n this.viewport = viewport;\n\n this.rootPointerEvent = new FederatedPointerEvent();\n this.rootWheelEvent = new FederatedWheelEvent();\n\n this.cursorStyles = {\n default: 'inherit',\n pointer: 'pointer'\n };\n\n this.resolution = resolution;\n this.setTargetElement(targetElement);\n }\n\n release(): void {\n this.setTargetElement(null);\n }\n\n setCursor(mode: string = 'default'): void {\n const { applyStyles, domElement } = this;\n\n if (this.currentCursor === mode) {\n return;\n }\n this.currentCursor = mode;\n const style = this.cursorStyles[mode];\n\n if (style) {\n if (typeof style === 'string' && applyStyles) {\n domElement.style.cursor = style;\n } else if (typeof style === 'function') {\n style(mode);\n } else if (typeof style === 'object' && applyStyles) {\n Object.assign(domElement.style, style);\n }\n } else if (applyStyles && isString(mode) && !has(this.cursorStyles, mode)) {\n domElement.style.cursor = mode;\n }\n }\n\n private onPointerDown = (nativeEvent: NativeEvent): void => {\n if (this.supportsTouchEvents && (nativeEvent as PointerEvent).pointerType === 'touch') {\n return;\n }\n\n const events = this.normalizeToPointerData(nativeEvent);\n\n if (this.autoPreventDefault && (events[0] as any).isNormalized) {\n const cancelable = nativeEvent.cancelable || !('cancelable' in nativeEvent);\n\n if (cancelable) {\n nativeEvent.preventDefault();\n }\n }\n\n for (let i = 0, j = events.length; i < j; i++) {\n const nativeEvent = events[i];\n const federatedEvent = this.bootstrapEvent(this.rootPointerEvent, nativeEvent);\n\n this.manager.mapEvent(federatedEvent);\n }\n\n this.setCursor(this.manager.cursor);\n };\n\n private onPointerMove = (nativeEvent: NativeEvent): void => {\n if (this.supportsTouchEvents && (nativeEvent as PointerEvent).pointerType === 'touch') {\n return;\n }\n\n if (this.isEventOutsideOfTargetElement(nativeEvent)) {\n return;\n }\n\n const normalizedEvents = this.normalizeToPointerData(nativeEvent);\n for (let i = 0, j = normalizedEvents.length; i < j; i++) {\n const event = this.bootstrapEvent(this.rootPointerEvent, normalizedEvents[i]);\n\n this.manager.mapEvent(event);\n }\n\n this.setCursor(this.manager.cursor);\n };\n\n private onPointerUp = (nativeEvent: NativeEvent): void => {\n if (this.supportsTouchEvents && (nativeEvent as PointerEvent).pointerType === 'touch') {\n return;\n }\n\n const outside = this.isEventOutsideOfTargetElement(nativeEvent) ? 'outside' : '';\n const normalizedEvents = this.normalizeToPointerData(nativeEvent);\n\n for (let i = 0, j = normalizedEvents.length; i < j; i++) {\n const event = this.bootstrapEvent(this.rootPointerEvent, normalizedEvents[i]);\n\n event.type += outside;\n\n this.manager.mapEvent(event);\n }\n\n this.setCursor(this.manager.cursor);\n };\n\n private onPointerOverOut = (nativeEvent: NativeEvent): void => {\n if (this.supportsTouchEvents && (nativeEvent as PointerEvent).pointerType === 'touch') {\n return;\n }\n\n const normalizedEvents = this.normalizeToPointerData(nativeEvent);\n\n for (let i = 0, j = normalizedEvents.length; i < j; i++) {\n const event = this.bootstrapEvent(this.rootPointerEvent, normalizedEvents[i]);\n\n this.manager.mapEvent(event);\n }\n\n this.setCursor(this.manager.cursor);\n };\n\n protected onWheel = (nativeEvent: WheelEvent): void => {\n const wheelEvent = this.normalizeWheelEvent(nativeEvent);\n\n this.manager.mapEvent(wheelEvent);\n };\n\n setTargetElement(element: IElementLike | null): void {\n this.removeEvents();\n this.domElement = element;\n this.addEvents();\n }\n\n private addEvents(): void {\n if (this.eventsAdded || !this.domElement) {\n return;\n }\n const { globalObj, domElement } = this;\n\n if (this.supportsPointerEvents) {\n if (globalObj.getDocument()) {\n globalObj.getDocument().addEventListener('pointermove', this.onPointerMove, true);\n globalObj.getDocument().addEventListener('pointerup', this.onPointerUp, true);\n } else {\n domElement.addEventListener('pointermove', this.onPointerMove, true);\n domElement.addEventListener('pointerup', this.onPointerUp, true);\n }\n domElement.addEventListener('pointerdown', this.onPointerDown, true);\n domElement.addEventListener('pointerleave', this.onPointerOverOut, true);\n domElement.addEventListener('pointerover', this.onPointerOverOut, true);\n } else {\n if (globalObj.getDocument()) {\n globalObj.getDocument().addEventListener('mousemove', this.onPointerMove, true);\n globalObj.getDocument().addEventListener('mouseup', this.onPointerUp, true);\n } else {\n domElement.addEventListener('mousemove', this.onPointerMove, true);\n domElement.addEventListener('mouseup', this.onPointerUp, true);\n }\n domElement.addEventListener('mousedown', this.onPointerDown, true);\n domElement.addEventListener('mouseout', this.onPointerOverOut, true);\n domElement.addEventListener('mouseover', this.onPointerOverOut, true);\n }\n\n if (this.supportsTouchEvents) {\n domElement.addEventListener('touchstart', this.onPointerDown, true);\n domElement.addEventListener('touchend', this.onPointerUp, true);\n domElement.addEventListener('touchmove', this.onPointerMove, true);\n }\n\n domElement.addEventListener('wheel', this.onWheel, {\n passive: true,\n capture: true\n });\n\n this.eventsAdded = true;\n }\n\n private removeEvents(): void {\n if (!this.eventsAdded || !this.domElement) {\n return;\n }\n const { globalObj, domElement } = this;\n\n if (this.supportsPointerEvents) {\n if (globalObj.getDocument()) {\n globalObj.getDocument().removeEventListener('pointermove', this.onPointerMove, true);\n globalObj.getDocument().removeEventListener('pointerup', this.onPointerUp, true);\n } else {\n domElement.removeEventListener('pointermove', this.onPointerMove, true);\n domElement.removeEventListener('pointerup', this.onPointerUp, true);\n }\n domElement.removeEventListener('pointerdown', this.onPointerDown, true);\n domElement.removeEventListener('pointerleave', this.onPointerOverOut, true);\n domElement.removeEventListener('pointerover', this.onPointerOverOut, true);\n } else {\n if (globalObj.getDocument()) {\n globalObj.getDocument().removeEventListener('mousemove', this.onPointerMove, true);\n globalObj.getDocument().removeEventListener('mouseup', this.onPointerUp, true);\n } else {\n domElement.removeEventListener('mousemove', this.onPointerMove, true);\n domElement.removeEventListener('mouseup', this.onPointerUp, true);\n }\n domElement.removeEventListener('mousedown', this.onPointerDown, true);\n domElement.removeEventListener('mouseout', this.onPointerOverOut, true);\n domElement.removeEventListener('mouseover', this.onPointerOverOut, true);\n }\n\n if (this.supportsTouchEvents) {\n domElement.removeEventListener('touchstart', this.onPointerDown, true);\n domElement.removeEventListener('touchend', this.onPointerUp, true);\n domElement.removeEventListener('touchmove', this.onPointerMove, true);\n }\n\n domElement.removeEventListener('wheel', this.onWheel, true);\n\n this.domElement = null;\n this.eventsAdded = false;\n }\n\n private mapToViewportPoint(event: FederatedMouseEvent): IPointLike {\n const viewport = this.viewport;\n const { x, y } = event;\n return {\n x: x - viewport.x,\n y: y - viewport.y\n };\n }\n\n private mapToCanvasPoint(nativeEvent: PointerEvent | WheelEvent): IPointLike {\n const point = this.globalObj?.mapToCanvasPoint(nativeEvent, this.domElement);\n\n if (point) {\n return point;\n }\n\n const { clientX: x, clientY: y } = nativeEvent;\n const rect = this.domElement.getBoundingClientRect();\n return {\n x: x - rect.left,\n y: y - rect.top\n };\n }\n\n private normalizeToPointerData(event: TouchEvent | MouseEvent | PointerEvent): PointerEvent[] {\n const normalizedEvents = [];\n\n if (\n this.supportsTouchEvents &&\n (event as TouchEvent).changedTouches &&\n (event as TouchEvent).changedTouches.length\n ) {\n for (let i = 0, li = (event as TouchEvent).changedTouches.length; i < li; i++) {\n const touch = (event as TouchEvent).changedTouches[i] as VRenderTouch;\n\n if (isUndefined(touch.button)) {\n touch.button = 0;\n }\n if (isUndefined(touch.buttons)) {\n touch.buttons = 1;\n }\n if (isUndefined(touch.isPrimary)) {\n touch.isPrimary = (event as TouchEvent).touches.length === 1 && event.type === 'touchstart';\n }\n if (isUndefined(touch.width)) {\n touch.width = touch.radiusX || 1;\n }\n if (isUndefined(touch.height)) {\n touch.height = touch.radiusY || 1;\n }\n if (isUndefined(touch.tiltX)) {\n touch.tiltX = 0;\n }\n if (isUndefined(touch.tiltY)) {\n touch.tiltY = 0;\n }\n if (isUndefined(touch.pointerType)) {\n touch.pointerType = 'touch';\n }\n if (isUndefined(touch.pointerId)) {\n touch.pointerId = touch.identifier || 0;\n }\n if (isUndefined(touch.pressure)) {\n touch.pressure = touch.force || 0.5;\n }\n if (isUndefined(touch.twist)) {\n touch.twist = 0;\n }\n if (isUndefined(touch.tangentialPressure)) {\n touch.tangentialPressure = 0;\n }\n if (isUndefined(touch.layerX)) {\n touch.layerX = touch.offsetX = touch.clientX;\n }\n if (isUndefined(touch.layerY)) {\n touch.layerY = touch.offsetY = touch.clientY;\n }\n\n touch.isNormalized = true;\n touch.type = event.type;\n\n normalizedEvents.push(touch);\n }\n } else if (\n !this.globalObj.supportsMouseEvents ||\n (event instanceof MouseEvent && (!this.supportsPointerEvents || !(event instanceof PointerEvent)))\n ) {\n const tempEvent = event as VRenderPointerEvent;\n\n if (isUndefined(tempEvent.isPrimary)) {\n tempEvent.isPrimary = true;\n }\n if (isUndefined(tempEvent.width)) {\n tempEvent.width = 1;\n }\n if (isUndefined(tempEvent.height)) {\n tempEvent.height = 1;\n }\n if (isUndefined(tempEvent.tiltX)) {\n tempEvent.tiltX = 0;\n }\n if (isUndefined(tempEvent.tiltY)) {\n tempEvent.tiltY = 0;\n }\n if (isUndefined(tempEvent.pointerType)) {\n tempEvent.pointerType = 'mouse';\n }\n if (isUndefined(tempEvent.pointerId)) {\n tempEvent.pointerId = MOUSE_POINTER_ID;\n }\n if (isUndefined(tempEvent.pressure)) {\n tempEvent.pressure = 0.5;\n }\n if (isUndefined(tempEvent.twist)) {\n tempEvent.twist = 0;\n }\n if (isUndefined(tempEvent.tangentialPressure)) {\n tempEvent.tangentialPressure = 0;\n }\n\n tempEvent.isNormalized = true;\n\n normalizedEvents.push(tempEvent);\n } else {\n normalizedEvents.push(event);\n }\n\n return normalizedEvents as PointerEvent[];\n }\n\n protected normalizeWheelEvent(nativeEvent: WheelEvent): FederatedWheelEvent {\n const event = this.rootWheelEvent;\n\n this.transferMouseData(event, nativeEvent);\n\n event.deltaMode = nativeEvent.deltaMode;\n event.deltaX = nativeEvent.deltaX;\n event.deltaY = nativeEvent.deltaY;\n event.deltaZ = nativeEvent.deltaZ;\n\n // 获取相对画布坐标\n const { x: canvasX, y: canvasY } = this.mapToCanvasPoint(nativeEvent);\n event.canvas.x = canvasX;\n event.canvas.y = canvasY;\n event.global.copyFrom(event.canvas);\n event.offset.copyFrom(event.canvas);\n\n // 获取相对绘图区域(viewport)坐标\n const { x: viewX, y: viewY } = this.mapToViewportPoint(event);\n event.viewport.x = viewX;\n event.viewport.y = viewY;\n\n event.nativeEvent = nativeEvent;\n event.type = nativeEvent.type;\n\n return event;\n }\n\n /**\n * Normalizes the {@code nativeEvent} into a federateed {@code FederatedPointerEvent}.\n * @param event\n * @param nativeEvent\n */\n private bootstrapEvent(event: FederatedPointerEvent, nativeEvent: PointerEvent): FederatedPointerEvent {\n event.originalEvent = null;\n event.nativeEvent = nativeEvent;\n\n event.pointerId = nativeEvent.pointerId;\n event.width = nativeEvent.width;\n event.height = nativeEvent.height;\n event.isPrimary = nativeEvent.isPrimary;\n event.pointerType = nativeEvent.pointerType;\n event.pressure = nativeEvent.pressure;\n event.tangentialPressure = nativeEvent.tangentialPressure;\n event.tiltX = nativeEvent.tiltX;\n event.tiltY = nativeEvent.tiltY;\n event.twist = nativeEvent.twist;\n this.transferMouseData(event, nativeEvent);\n\n const { x: canvasX, y: canvasY } = this.mapToCanvasPoint(nativeEvent);\n event.canvas.x = canvasX;\n event.canvas.y = canvasY;\n event.global.copyFrom(event.canvas);\n event.offset.copyFrom(event.canvas);\n\n // 获取相对绘图区域(viewport)坐标\n const { x: viewX, y: viewY } = this.mapToViewportPoint(event);\n event.viewport.x = viewX;\n event.viewport.y = viewY;\n\n event.isTrusted = nativeEvent.isTrusted;\n if (event.type === 'pointerleave') {\n event.type = 'pointerout';\n }\n if (event.type.startsWith('mouse')) {\n event.type = event.type.replace('mouse', 'pointer');\n }\n if (event.type.startsWith('touch')) {\n event.type = TOUCH_TO_POINTER[event.type] || event.type;\n }\n\n return event;\n }\n\n /**\n * Transfers base & mouse event data from the {@code nativeEvent} to the federated event.\n * @param event\n * @param nativeEvent\n */\n private transferMouseData(event: FederatedMouseEvent, nativeEvent: MouseEvent): void {\n event.isTrusted = nativeEvent.isTrusted;\n event.srcElement = nativeEvent.srcElement as IEventTarget;\n event.timeStamp = clock.now();\n event.type = nativeEvent.type;\n\n event.altKey = nativeEvent.altKey;\n event.button = nativeEvent.button;\n event.buttons = nativeEvent.buttons;\n event.client.x = nativeEvent.clientX;\n event.client.y = nativeEvent.clientY;\n event.ctrlKey = nativeEvent.ctrlKey;\n event.shiftKey = nativeEvent.shiftKey;\n event.metaKey = nativeEvent.metaKey;\n event.movement.x = nativeEvent.movementX;\n event.movement.y = nativeEvent.movementY;\n event.page.x = nativeEvent.pageX;\n event.page.y = nativeEvent.pageY;\n event.relatedTarget = null;\n }\n\n private isEventOutsideOfTargetElement(nativeEvent: NativeEvent) {\n let target = nativeEvent.target;\n\n if (nativeEvent.composedPath && nativeEvent.composedPath().length > 0) {\n target = nativeEvent.composedPath()[0];\n }\n\n const nativeElement = this.domElement.getNativeHandler\n ? this.domElement.getNativeHandler().nativeCanvas\n : this.domElement;\n\n return target !== nativeElement;\n }\n}\n\ninterface VRenderPointerEvent extends PointerEvent {\n isPrimary: boolean;\n width: number;\n height: number;\n tiltX: number;\n tiltY: number;\n pointerType: string;\n pointerId: number;\n pressure: number;\n twist: number;\n tangentialPressure: number;\n isNormalized: boolean;\n type: string;\n}\n\ninterface VRenderTouch extends Touch {\n button: number;\n buttons: number;\n isPrimary: boolean;\n width: number;\n height: number;\n tiltX: number;\n tiltY: number;\n pointerType: string;\n pointerId: number;\n pressure: number;\n twist: number;\n tangentialPressure: number;\n layerX: number;\n layerY: number;\n offsetX: number;\n offsetY: number;\n isNormalized: boolean;\n type: string;\n}\n"]}
1
+ {"version":3,"sources":["../../src/event/event-system.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,QAAQ,EAAc,MAAM,kBAAkB,CAAC;AAE1E,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAI/E,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE/B,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAC3B,MAAM,gBAAgB,GAA2B;IAC/C,UAAU,EAAE,aAAa;IACzB,QAAQ,EAAE,WAAW;IACrB,eAAe,EAAE,kBAAkB;IACnC,SAAS,EAAE,aAAa;IACxB,WAAW,EAAE,eAAe;CAC7B,CAAC;AA8BF,MAAM,OAAO,WAAW;IAiDtB,YAAY,MAAoB;QAPhC,eAAU,GAAG,CAAC,CAAC;QA2DP,kBAAa,GAAG,CAAC,WAAwB,EAAQ,EAAE;YACzD,IAAI,IAAI,CAAC,mBAAmB,IAAK,WAA4B,CAAC,WAAW,KAAK,OAAO,EAAE;gBACrF,OAAO;aACR;YAED,MAAM,MAAM,GAAG,IAAI,CAAC,sBAAsB,CAAC,WAAW,CAAC,CAAC;YAExD,IAAI,IAAI,CAAC,kBAAkB,IAAK,MAAM,CAAC,CAAC,CAAS,CAAC,YAAY,EAAE;gBAC9D,MAAM,UAAU,GAAG,WAAW,CAAC,UAAU,IAAI,CAAC,CAAC,YAAY,IAAI,WAAW,CAAC,CAAC;gBA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AS,CAAC;QACzC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC;QACjC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC;QACjC,KAAK,CAAC,aAAa,GAAG,IAAI,CAAC;IAC7B,CAAC;IAEO,6BAA6B,CAAC,WAAwB;QAC5D,IAAI,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC;QAEhC,IAAI,WAAW,CAAC,YAAY,IAAI,WAAW,CAAC,YAAY,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE;YACrE,MAAM,GAAG,WAAW,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC;SACxC;QAED,MAAM,aAAa,GAAG,IAAI,CAAC,UAAU,CAAC,gBAAgB;YACpD,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC,YAAY;YACjD,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC;QAEpB,OAAO,MAAM,KAAK,aAAa,CAAC;IAClC,CAAC;CACF","file":"event-system.js","sourcesContent":["import { isUndefined, has, isString, IPointLike } from '@visactor/vutils';\nimport { IGlobal } from '../interface';\nimport { EventManager } from './event-manager';\nimport { FederatedPointerEvent, FederatedWheelEvent } from './federated-event';\nimport type { FederatedMouseEvent } from './federated-event/mouse-event';\nimport type { IEventTarget } from './interface';\nimport type { IElementLike, NativeEvent, RenderConfig } from './type';\nimport { clock } from './util';\n\nconst MOUSE_POINTER_ID = 1;\nconst TOUCH_TO_POINTER: Record<string, string> = {\n touchstart: 'pointerdown',\n touchend: 'pointerup',\n touchendoutside: 'pointerupoutside',\n touchmove: 'pointermove',\n touchcancel: 'pointercancel'\n};\n\n/**\n * 代码参考自 https://github.com/pixijs/pixijs\n * The MIT License\n\n Copyright (c) 2013-2023 Mathew Groves, Chad Engler\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n */\n\n/**\n * The system for handling UI events.\n */\nexport class EventSystem {\n private readonly globalObj: IGlobal;\n readonly manager: EventManager;\n\n /** Does the device support touch events https://www.w3.org/TR/touch-events/ */\n // readonly supportsTouchEvents = 'ontouchstart' in this.globalObj;\n readonly supportsTouchEvents: boolean;\n\n /** Does the device support pointer events https://www.w3.org/Submission/pointer-events/ */\n // readonly supportsPointerEvents = !!this.globalObj.PointerEvent;\n readonly supportsPointerEvents: boolean;\n\n readonly supportsMouseEvents: boolean;\n\n readonly applyStyles: boolean;\n\n readonly viewport: RenderConfig['viewport'];\n\n /**\n * Should default browser actions automatically be prevented.\n * Does not apply to pointer events for backwards compatibility\n * preventDefault on pointer events stops mouse events from firing\n * Thus, for every pointer event, there will always be either a mouse of touch event alongside it.\n * @default false\n */\n autoPreventDefault: boolean;\n\n /**\n * Dictionary of how different cursor modes are handled. Strings are handled as CSS cursor\n * values, objects are handled as dictionaries of CSS values for domElement,\n * and functions are called instead of changing the CSS.\n * Default CSS cursor values are provided for 'default' and 'pointer' modes.\n * @member {Object<string, string | ((mode: string) => void) | CSSStyleDeclaration>}\n */\n cursorStyles: Record<string, string | ((mode: string) => void) | CSSStyleDeclaration>;\n\n /**\n * The DOM element to which the root event listeners are bound. This is automatically set to\n */\n domElement: IElementLike | null;\n\n /** The resolution used to convert between the DOM client space into world space. */\n resolution = 1;\n\n private currentCursor: string;\n private rootPointerEvent: FederatedPointerEvent;\n private rootWheelEvent: FederatedWheelEvent;\n private eventsAdded: boolean;\n\n constructor(params: RenderConfig) {\n const { targetElement, resolution, rootNode, global, viewport, autoPreventDefault = false } = params;\n this.manager = new EventManager(rootNode);\n\n this.globalObj = global;\n this.supportsPointerEvents = global.supportsPointerEvents;\n this.supportsTouchEvents = global.supportsTouchEvents;\n this.supportsMouseEvents = global.supportsMouseEvents;\n this.applyStyles = global.applyStyles;\n\n this.autoPreventDefault = autoPreventDefault;\n this.eventsAdded = false;\n this.viewport = viewport;\n\n this.rootPointerEvent = new FederatedPointerEvent();\n this.rootWheelEvent = new FederatedWheelEvent();\n\n this.cursorStyles = {\n default: 'inherit',\n pointer: 'pointer'\n };\n\n this.resolution = resolution;\n this.setTargetElement(targetElement);\n }\n\n release(): void {\n this.setTargetElement(null);\n }\n\n setCursor(mode: string = 'default'): void {\n const { applyStyles, domElement } = this;\n\n if (this.currentCursor === mode) {\n return;\n }\n this.currentCursor = mode;\n const style = this.cursorStyles[mode];\n\n if (style) {\n if (typeof style === 'string' && applyStyles) {\n domElement.style.cursor = style;\n } else if (typeof style === 'function') {\n style(mode);\n } else if (typeof style === 'object' && applyStyles) {\n Object.assign(domElement.style, style);\n }\n } else if (applyStyles && isString(mode) && !has(this.cursorStyles, mode)) {\n domElement.style.cursor = mode;\n }\n }\n\n private onPointerDown = (nativeEvent: NativeEvent): void => {\n if (this.supportsTouchEvents && (nativeEvent as PointerEvent).pointerType === 'touch') {\n return;\n }\n\n const events = this.normalizeToPointerData(nativeEvent);\n\n if (this.autoPreventDefault && (events[0] as any).isNormalized) {\n const cancelable = nativeEvent.cancelable || !('cancelable' in nativeEvent);\n\n if (cancelable) {\n nativeEvent.preventDefault();\n }\n }\n\n for (let i = 0, j = events.length; i < j; i++) {\n const nativeEvent = events[i];\n const federatedEvent = this.bootstrapEvent(this.rootPointerEvent, nativeEvent);\n\n this.manager.mapEvent(federatedEvent);\n }\n\n this.setCursor(this.manager.cursor);\n };\n\n private onPointerMove = (nativeEvent: NativeEvent): void => {\n if (this.supportsTouchEvents && (nativeEvent as PointerEvent).pointerType === 'touch') {\n return;\n }\n\n if (this.isEventOutsideOfTargetElement(nativeEvent)) {\n return;\n }\n\n const normalizedEvents = this.normalizeToPointerData(nativeEvent);\n for (let i = 0, j = normalizedEvents.length; i < j; i++) {\n const event = this.bootstrapEvent(this.rootPointerEvent, normalizedEvents[i]);\n\n this.manager.mapEvent(event);\n }\n\n this.setCursor(this.manager.cursor);\n };\n\n private onPointerUp = (nativeEvent: NativeEvent): void => {\n if (this.supportsTouchEvents && (nativeEvent as PointerEvent).pointerType === 'touch') {\n return;\n }\n\n const outside = this.isEventOutsideOfTargetElement(nativeEvent) ? 'outside' : '';\n const normalizedEvents = this.normalizeToPointerData(nativeEvent);\n\n for (let i = 0, j = normalizedEvents.length; i < j; i++) {\n const event = this.bootstrapEvent(this.rootPointerEvent, normalizedEvents[i]);\n\n event.type += outside;\n\n this.manager.mapEvent(event);\n }\n\n this.setCursor(this.manager.cursor);\n };\n\n private onPointerOverOut = (nativeEvent: NativeEvent): void => {\n if (this.supportsTouchEvents && (nativeEvent as PointerEvent).pointerType === 'touch') {\n return;\n }\n\n const normalizedEvents = this.normalizeToPointerData(nativeEvent);\n\n for (let i = 0, j = normalizedEvents.length; i < j; i++) {\n const event = this.bootstrapEvent(this.rootPointerEvent, normalizedEvents[i]);\n\n this.manager.mapEvent(event);\n }\n\n this.setCursor(this.manager.cursor);\n };\n\n protected onWheel = (nativeEvent: WheelEvent): void => {\n const wheelEvent = this.normalizeWheelEvent(nativeEvent);\n\n this.manager.mapEvent(wheelEvent);\n };\n\n setTargetElement(element: IElementLike | null): void {\n this.removeEvents();\n this.domElement = element;\n this.addEvents();\n }\n\n private addEvents(): void {\n if (this.eventsAdded || !this.domElement) {\n return;\n }\n const { globalObj, domElement } = this;\n\n if (this.supportsPointerEvents) {\n if (globalObj.getDocument()) {\n globalObj.getDocument().addEventListener('pointermove', this.onPointerMove, true);\n globalObj.getDocument().addEventListener('pointerup', this.onPointerUp, true);\n } else {\n domElement.addEventListener('pointermove', this.onPointerMove, true);\n domElement.addEventListener('pointerup', this.onPointerUp, true);\n }\n domElement.addEventListener('pointerdown', this.onPointerDown, true);\n domElement.addEventListener('pointerleave', this.onPointerOverOut, true);\n domElement.addEventListener('pointerover', this.onPointerOverOut, true);\n } else {\n if (globalObj.getDocument()) {\n globalObj.getDocument().addEventListener('mousemove', this.onPointerMove, true);\n globalObj.getDocument().addEventListener('mouseup', this.onPointerUp, true);\n } else {\n domElement.addEventListener('mousemove', this.onPointerMove, true);\n domElement.addEventListener('mouseup', this.onPointerUp, true);\n }\n domElement.addEventListener('mousedown', this.onPointerDown, true);\n domElement.addEventListener('mouseout', this.onPointerOverOut, true);\n domElement.addEventListener('mouseover', this.onPointerOverOut, true);\n }\n\n if (this.supportsTouchEvents) {\n domElement.addEventListener('touchstart', this.onPointerDown, true);\n domElement.addEventListener('touchend', this.onPointerUp, true);\n domElement.addEventListener('touchmove', this.onPointerMove, true);\n }\n\n domElement.addEventListener('wheel', this.onWheel, {\n capture: true\n });\n\n this.eventsAdded = true;\n }\n\n private removeEvents(): void {\n if (!this.eventsAdded || !this.domElement) {\n return;\n }\n const { globalObj, domElement } = this;\n\n if (this.supportsPointerEvents) {\n if (globalObj.getDocument()) {\n globalObj.getDocument().removeEventListener('pointermove', this.onPointerMove, true);\n globalObj.getDocument().removeEventListener('pointerup', this.onPointerUp, true);\n } else {\n domElement.removeEventListener('pointermove', this.onPointerMove, true);\n domElement.removeEventListener('pointerup', this.onPointerUp, true);\n }\n domElement.removeEventListener('pointerdown', this.onPointerDown, true);\n domElement.removeEventListener('pointerleave', this.onPointerOverOut, true);\n domElement.removeEventListener('pointerover', this.onPointerOverOut, true);\n } else {\n if (globalObj.getDocument()) {\n globalObj.getDocument().removeEventListener('mousemove', this.onPointerMove, true);\n globalObj.getDocument().removeEventListener('mouseup', this.onPointerUp, true);\n } else {\n domElement.removeEventListener('mousemove', this.onPointerMove, true);\n domElement.removeEventListener('mouseup', this.onPointerUp, true);\n }\n domElement.removeEventListener('mousedown', this.onPointerDown, true);\n domElement.removeEventListener('mouseout', this.onPointerOverOut, true);\n domElement.removeEventListener('mouseover', this.onPointerOverOut, true);\n }\n\n if (this.supportsTouchEvents) {\n domElement.removeEventListener('touchstart', this.onPointerDown, true);\n domElement.removeEventListener('touchend', this.onPointerUp, true);\n domElement.removeEventListener('touchmove', this.onPointerMove, true);\n }\n\n domElement.removeEventListener('wheel', this.onWheel, true);\n\n this.domElement = null;\n this.eventsAdded = false;\n }\n\n private mapToViewportPoint(event: FederatedMouseEvent): IPointLike {\n const viewport = this.viewport;\n const { x, y } = event;\n return {\n x: x - viewport.x,\n y: y - viewport.y\n };\n }\n\n private mapToCanvasPoint(nativeEvent: PointerEvent | WheelEvent): IPointLike {\n const point = this.globalObj?.mapToCanvasPoint(nativeEvent, this.domElement);\n\n if (point) {\n return point;\n }\n\n const { clientX: x, clientY: y } = nativeEvent;\n const rect = this.domElement.getBoundingClientRect();\n return {\n x: x - rect.left,\n y: y - rect.top\n };\n }\n\n private normalizeToPointerData(event: TouchEvent | MouseEvent | PointerEvent): PointerEvent[] {\n const normalizedEvents = [];\n\n if (\n this.supportsTouchEvents &&\n (event as TouchEvent).changedTouches &&\n (event as TouchEvent).changedTouches.length\n ) {\n for (let i = 0, li = (event as TouchEvent).changedTouches.length; i < li; i++) {\n const touch = (event as TouchEvent).changedTouches[i] as VRenderTouch;\n\n if (isUndefined(touch.button)) {\n touch.button = 0;\n }\n if (isUndefined(touch.buttons)) {\n touch.buttons = 1;\n }\n if (isUndefined(touch.isPrimary)) {\n touch.isPrimary = (event as TouchEvent).touches.length === 1 && event.type === 'touchstart';\n }\n if (isUndefined(touch.width)) {\n touch.width = touch.radiusX || 1;\n }\n if (isUndefined(touch.height)) {\n touch.height = touch.radiusY || 1;\n }\n if (isUndefined(touch.tiltX)) {\n touch.tiltX = 0;\n }\n if (isUndefined(touch.tiltY)) {\n touch.tiltY = 0;\n }\n if (isUndefined(touch.pointerType)) {\n touch.pointerType = 'touch';\n }\n if (isUndefined(touch.pointerId)) {\n touch.pointerId = touch.identifier || 0;\n }\n if (isUndefined(touch.pressure)) {\n touch.pressure = touch.force || 0.5;\n }\n if (isUndefined(touch.twist)) {\n touch.twist = 0;\n }\n if (isUndefined(touch.tangentialPressure)) {\n touch.tangentialPressure = 0;\n }\n if (isUndefined(touch.layerX)) {\n touch.layerX = touch.offsetX = touch.clientX;\n }\n if (isUndefined(touch.layerY)) {\n touch.layerY = touch.offsetY = touch.clientY;\n }\n\n touch.isNormalized = true;\n touch.type = event.type;\n\n normalizedEvents.push(touch);\n }\n } else if (\n !this.globalObj.supportsMouseEvents ||\n (event instanceof MouseEvent && (!this.supportsPointerEvents || !(event instanceof PointerEvent)))\n ) {\n const tempEvent = event as VRenderPointerEvent;\n\n if (isUndefined(tempEvent.isPrimary)) {\n tempEvent.isPrimary = true;\n }\n if (isUndefined(tempEvent.width)) {\n tempEvent.width = 1;\n }\n if (isUndefined(tempEvent.height)) {\n tempEvent.height = 1;\n }\n if (isUndefined(tempEvent.tiltX)) {\n tempEvent.tiltX = 0;\n }\n if (isUndefined(tempEvent.tiltY)) {\n tempEvent.tiltY = 0;\n }\n if (isUndefined(tempEvent.pointerType)) {\n tempEvent.pointerType = 'mouse';\n }\n if (isUndefined(tempEvent.pointerId)) {\n tempEvent.pointerId = MOUSE_POINTER_ID;\n }\n if (isUndefined(tempEvent.pressure)) {\n tempEvent.pressure = 0.5;\n }\n if (isUndefined(tempEvent.twist)) {\n tempEvent.twist = 0;\n }\n if (isUndefined(tempEvent.tangentialPressure)) {\n tempEvent.tangentialPressure = 0;\n }\n\n tempEvent.isNormalized = true;\n\n normalizedEvents.push(tempEvent);\n } else {\n normalizedEvents.push(event);\n }\n\n return normalizedEvents as PointerEvent[];\n }\n\n protected normalizeWheelEvent(nativeEvent: WheelEvent): FederatedWheelEvent {\n const event = this.rootWheelEvent;\n\n this.transferMouseData(event, nativeEvent);\n\n event.deltaMode = nativeEvent.deltaMode;\n event.deltaX = nativeEvent.deltaX;\n event.deltaY = nativeEvent.deltaY;\n event.deltaZ = nativeEvent.deltaZ;\n\n // 获取相对画布坐标\n const { x: canvasX, y: canvasY } = this.mapToCanvasPoint(nativeEvent);\n event.canvas.x = canvasX;\n event.canvas.y = canvasY;\n event.global.copyFrom(event.canvas);\n event.offset.copyFrom(event.canvas);\n\n // 获取相对绘图区域(viewport)坐标\n const { x: viewX, y: viewY } = this.mapToViewportPoint(event);\n event.viewport.x = viewX;\n event.viewport.y = viewY;\n\n event.nativeEvent = nativeEvent;\n event.type = nativeEvent.type;\n\n return event;\n }\n\n /**\n * Normalizes the {@code nativeEvent} into a federateed {@code FederatedPointerEvent}.\n * @param event\n * @param nativeEvent\n */\n private bootstrapEvent(event: FederatedPointerEvent, nativeEvent: PointerEvent): FederatedPointerEvent {\n event.originalEvent = null;\n event.nativeEvent = nativeEvent;\n\n event.pointerId = nativeEvent.pointerId;\n event.width = nativeEvent.width;\n event.height = nativeEvent.height;\n event.isPrimary = nativeEvent.isPrimary;\n event.pointerType = nativeEvent.pointerType;\n event.pressure = nativeEvent.pressure;\n event.tangentialPressure = nativeEvent.tangentialPressure;\n event.tiltX = nativeEvent.tiltX;\n event.tiltY = nativeEvent.tiltY;\n event.twist = nativeEvent.twist;\n this.transferMouseData(event, nativeEvent);\n\n const { x: canvasX, y: canvasY } = this.mapToCanvasPoint(nativeEvent);\n event.canvas.x = canvasX;\n event.canvas.y = canvasY;\n event.global.copyFrom(event.canvas);\n event.offset.copyFrom(event.canvas);\n\n // 获取相对绘图区域(viewport)坐标\n const { x: viewX, y: viewY } = this.mapToViewportPoint(event);\n event.viewport.x = viewX;\n event.viewport.y = viewY;\n\n event.isTrusted = nativeEvent.isTrusted;\n if (event.type === 'pointerleave') {\n event.type = 'pointerout';\n }\n if (event.type.startsWith('mouse')) {\n event.type = event.type.replace('mouse', 'pointer');\n }\n if (event.type.startsWith('touch')) {\n event.type = TOUCH_TO_POINTER[event.type] || event.type;\n }\n\n return event;\n }\n\n /**\n * Transfers base & mouse event data from the {@code nativeEvent} to the federated event.\n * @param event\n * @param nativeEvent\n */\n private transferMouseData(event: FederatedMouseEvent, nativeEvent: MouseEvent): void {\n event.isTrusted = nativeEvent.isTrusted;\n event.srcElement = nativeEvent.srcElement as IEventTarget;\n event.timeStamp = clock.now();\n event.type = nativeEvent.type;\n\n event.altKey = nativeEvent.altKey;\n event.button = nativeEvent.button;\n event.buttons = nativeEvent.buttons;\n event.client.x = nativeEvent.clientX;\n event.client.y = nativeEvent.clientY;\n event.ctrlKey = nativeEvent.ctrlKey;\n event.shiftKey = nativeEvent.shiftKey;\n event.metaKey = nativeEvent.metaKey;\n event.movement.x = nativeEvent.movementX;\n event.movement.y = nativeEvent.movementY;\n event.page.x = nativeEvent.pageX;\n event.page.y = nativeEvent.pageY;\n event.relatedTarget = null;\n }\n\n private isEventOutsideOfTargetElement(nativeEvent: NativeEvent) {\n let target = nativeEvent.target;\n\n if (nativeEvent.composedPath && nativeEvent.composedPath().length > 0) {\n target = nativeEvent.composedPath()[0];\n }\n\n const nativeElement = this.domElement.getNativeHandler\n ? this.domElement.getNativeHandler().nativeCanvas\n : this.domElement;\n\n return target !== nativeElement;\n }\n}\n\ninterface VRenderPointerEvent extends PointerEvent {\n isPrimary: boolean;\n width: number;\n height: number;\n tiltX: number;\n tiltY: number;\n pointerType: string;\n pointerId: number;\n pressure: number;\n twist: number;\n tangentialPressure: number;\n isNormalized: boolean;\n type: string;\n}\n\ninterface VRenderTouch extends Touch {\n button: number;\n buttons: number;\n isPrimary: boolean;\n width: number;\n height: number;\n tiltX: number;\n tiltY: number;\n pointerType: string;\n pointerId: number;\n pressure: number;\n twist: number;\n tangentialPressure: number;\n layerX: number;\n layerY: number;\n offsetX: number;\n offsetY: number;\n isNormalized: boolean;\n type: string;\n}\n"]}
@@ -9,7 +9,7 @@ export class FederatedWheelEvent extends FederatedMouseEvent {
9
9
  const event = new FederatedWheelEvent(this.manager);
10
10
  return event.eventPhase = event.NONE, event.currentTarget = null, event.path = [],
11
11
  event.target = null, event.nativeEvent = this.nativeEvent, event.originalEvent = this.originalEvent,
12
- null === (_a = this.manager) || void 0 === _a || _a.copyPointerData(this, event),
12
+ null === (_a = this.manager) || void 0 === _a || _a.copyWheelData(this, event),
13
13
  null === (_b = this.manager) || void 0 === _b || _b.copyMouseData(this, event),
14
14
  null === (_c = this.manager) || void 0 === _c || _c.copyData(this, event), event.target = this.target,
15
15
  event.path = this.composedPath().slice(), event.type = this.type, event;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/event/federated-event/wheel-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AA0BpD,MAAM,OAAO,mBAAoB,SAAQ,mBAAmB;IAA5D;;QAkBW,oBAAe,GAAG,CAAC,CAAC;QAIpB,mBAAc,GAAG,CAAC,CAAC;QAInB,mBAAc,GAAG,CAAC,CAAC;IAuB9B,CAAC;IArBC,KAAK;;QACH,MAAM,KAAK,GAAG,IAAI,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAEpD,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC;QAC9B,KAAK,CAAC,aAAa,GAAG,IAAI,CAAC;QAC3B,KAAK,CAAC,IAAI,GAAG,EAAE,CAAC;QAChB,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;QAEpB,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QACrC,KAAK,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;QAEzC,MAAA,IAAI,CAAC,OAAO,0CAAE,eAAe,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC3C,MAAA,IAAI,CAAC,OAAO,0CAAE,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACzC,MAAA,IAAI,CAAC,OAAO,0CAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAEpC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC,KAAK,EAAE,CAAC;QACzC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QAEvB,OAAO,KAAK,CAAC;IACf,CAAC;;AAhCe,mCAAe,GAAG,CAAC,CAAC;AAIpB,kCAAc,GAAG,CAAC,CAAC;AAInB,kCAAc,GAAG,CAAC,CAAC","file":"wheel-event.js","sourcesContent":["import { FederatedMouseEvent } from './mouse-event';\n/**\n * 代码参考自 https://github.com/pixijs/pixijs\n * The MIT License\n\n Copyright (c) 2013-2023 Mathew Groves, Chad Engler\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n */\n\nexport class FederatedWheelEvent extends FederatedMouseEvent implements WheelEvent {\n /**\n * The units of `deltaX`, `deltaY`, and `deltaZ`. This is one of `DOM_DELTA_LINE`,\n * `DOM_DELTA_PAGE`, `DOM_DELTA_PIXEL`.\n */\n deltaMode: number;\n\n /** Horizontal scroll amount */\n deltaX: number;\n\n /** Vertical scroll amount */\n deltaY: number;\n\n /** z-axis scroll amount. */\n deltaZ: number;\n\n static readonly DOM_DELTA_PIXEL = 0;\n\n readonly DOM_DELTA_PIXEL = 0;\n\n static readonly DOM_DELTA_LINE = 1;\n\n readonly DOM_DELTA_LINE = 1;\n\n static readonly DOM_DELTA_PAGE = 2;\n\n readonly DOM_DELTA_PAGE = 2;\n\n clone() {\n const event = new FederatedWheelEvent(this.manager);\n\n event.eventPhase = event.NONE;\n event.currentTarget = null;\n event.path = [];\n event.target = null;\n\n event.nativeEvent = this.nativeEvent;\n event.originalEvent = this.originalEvent;\n\n this.manager?.copyPointerData(this, event);\n this.manager?.copyMouseData(this, event);\n this.manager?.copyData(this, event);\n\n event.target = this.target;\n event.path = this.composedPath().slice();\n event.type = this.type;\n\n return event;\n }\n}\n"]}
1
+ {"version":3,"sources":["../../src/event/federated-event/wheel-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AA0BpD,MAAM,OAAO,mBAAoB,SAAQ,mBAAmB;IAA5D;;QAkBW,oBAAe,GAAG,CAAC,CAAC;QAIpB,mBAAc,GAAG,CAAC,CAAC;QAInB,mBAAc,GAAG,CAAC,CAAC;IAuB9B,CAAC;IArBC,KAAK;;QACH,MAAM,KAAK,GAAG,IAAI,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAEpD,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC;QAC9B,KAAK,CAAC,aAAa,GAAG,IAAI,CAAC;QAC3B,KAAK,CAAC,IAAI,GAAG,EAAE,CAAC;QAChB,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;QAEpB,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QACrC,KAAK,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;QAEzC,MAAA,IAAI,CAAC,OAAO,0CAAE,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACzC,MAAA,IAAI,CAAC,OAAO,0CAAE,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACzC,MAAA,IAAI,CAAC,OAAO,0CAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAEpC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC,KAAK,EAAE,CAAC;QACzC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QAEvB,OAAO,KAAK,CAAC;IACf,CAAC;;AAhCe,mCAAe,GAAG,CAAC,CAAC;AAIpB,kCAAc,GAAG,CAAC,CAAC;AAInB,kCAAc,GAAG,CAAC,CAAC","file":"wheel-event.js","sourcesContent":["import { FederatedMouseEvent } from './mouse-event';\n/**\n * 代码参考自 https://github.com/pixijs/pixijs\n * The MIT License\n\n Copyright (c) 2013-2023 Mathew Groves, Chad Engler\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n */\n\nexport class FederatedWheelEvent extends FederatedMouseEvent implements WheelEvent {\n /**\n * The units of `deltaX`, `deltaY`, and `deltaZ`. This is one of `DOM_DELTA_LINE`,\n * `DOM_DELTA_PAGE`, `DOM_DELTA_PIXEL`.\n */\n deltaMode: number;\n\n /** Horizontal scroll amount */\n deltaX: number;\n\n /** Vertical scroll amount */\n deltaY: number;\n\n /** z-axis scroll amount. */\n deltaZ: number;\n\n static readonly DOM_DELTA_PIXEL = 0;\n\n readonly DOM_DELTA_PIXEL = 0;\n\n static readonly DOM_DELTA_LINE = 1;\n\n readonly DOM_DELTA_LINE = 1;\n\n static readonly DOM_DELTA_PAGE = 2;\n\n readonly DOM_DELTA_PAGE = 2;\n\n clone() {\n const event = new FederatedWheelEvent(this.manager);\n\n event.eventPhase = event.NONE;\n event.currentTarget = null;\n event.path = [];\n event.target = null;\n\n event.nativeEvent = this.nativeEvent;\n event.originalEvent = this.originalEvent;\n\n this.manager?.copyWheelData(this, event);\n this.manager?.copyMouseData(this, event);\n this.manager?.copyData(this, event);\n\n event.target = this.target;\n event.path = this.composedPath().slice();\n event.type = this.type;\n\n return event;\n }\n}\n"]}
@@ -169,7 +169,6 @@ export const DefaultPolygonAttribute = Object.assign(Object.assign({}, DefaultAt
169
169
  export const DefaultRectAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
170
170
  width: 0,
171
171
  height: 0,
172
- strokeBoundsBuffer: 0,
173
172
  cornerRadius: 0
174
173
  });
175
174
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/graphic/config.ts"],"names":[],"mappings":"A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AM,qBAAqB,iCAChC,OAAO,EAAE,SAAS,EAClB,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,EAAE,EACT,KAAK,EAAE,CAAC,EACR,MAAM,EAAE,CAAC,IACN,gBAAgB,KACnB,IAAI,EAAE,IAAI,GACX,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,mCACpC,qBAAqB,KACxB,kBAAkB,EAAE,OAAO,EAC3B,eAAe,EAAE,CAAC,EAClB,gBAAgB,EAAE,CAAC,EACnB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,QAAQ,EACtB,SAAS,EAAE,YAAY,EACvB,MAAM,EAAE,CAAC,EACT,EAAE,EAAE,EAAE,EAEN,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,EACV,cAAc,EAAE,0BAA0B,EAC1C,qBAAqB,EAAE,CAAC,EACxB,gBAAgB,EAAE,KAAK,EACvB,uBAAuB,EAAE,CAAC,EAC1B,gBAAgB,EAAE,CAAC,EACnB,OAAO,EAAE,CAAC,GACX,CAAC","file":"config.js","sourcesContent":["// 存放公共属性\nimport { Matrix, pi2 } from '@visactor/vutils';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport {\n IArcGraphicAttribute,\n IAreaGraphicAttribute,\n IGraphicAttribute,\n ICircleGraphicAttribute,\n IFillStyle,\n IGlyphGraphicAttribute,\n IGroupGraphicAttribute,\n IImageGraphicAttribute,\n ILineGraphicAttribute,\n IPathGraphicAttribute,\n IPolygonGraphicAttribute,\n IRect3dGraphicAttribute,\n IRectGraphicAttribute,\n IStrokeStyle,\n IGraphicStyle,\n ISymbolGraphicAttribute,\n ITextAttribute,\n ITextGraphicAttribute,\n IRichTextGraphicAttribute,\n ITransform,\n RichTextWordBreak,\n RichTextVerticalDirection,\n RichTextGlobalAlignType,\n RichTextGlobalBaselineType,\n IRichTextIconGraphicAttribute\n} from '../interface';\n\nexport const DefaultTransform: ITransform = {\n x: 0,\n y: 0,\n z: 0,\n dx: 0,\n dy: 0,\n dz: 0,\n scrollX: 0,\n scrollY: 0,\n scaleX: 1,\n scaleY: 1,\n scaleZ: 1,\n angle: 0,\n alpha: 0,\n beta: 0,\n anchor: [0, 0],\n anchor3d: [0, 0],\n postMatrix: new Matrix()\n};\n\nexport const DefaultFillStyle: IFillStyle = {\n fillOpacity: 1,\n fill: false,\n shadowBlur: 0,\n shadowColor: 'black',\n shadowOffsetX: 0,\n shadowOffsetY: 0\n};\n\nconst commonStroke: Omit<IStrokeStyle, 'outerBorder' | 'innerBorder'> = {\n strokeOpacity: 1,\n lineDash: [],\n lineDashOffset: 0,\n lineWidth: 1,\n lineCap: 'butt',\n lineJoin: 'miter',\n miterLimit: 10,\n strokeBoundsBuffer: 2,\n stroke: false\n};\n\nexport const DefaultStrokeStyle: IStrokeStyle = {\n outerBorder: { ...commonStroke, distance: 0 },\n innerBorder: { ...commonStroke, distance: 0 },\n ...commonStroke\n};\n\nexport const DefaultTextStyle: Required<ITextAttribute> = {\n text: '',\n maxLineWidth: Infinity,\n textAlign: 'left',\n textBaseline: 'alphabetic',\n fontSize: 16,\n // @ts-ignore\n fontFamily: `PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol`,\n fontWeight: '',\n ellipsis: '…',\n fontVariant: '',\n fontStyle: '',\n lineHeight: undefined,\n underline: 0,\n lineThrough: 0\n};\n\nexport const DefaultStyle: IGraphicStyle = {\n opacity: 1,\n background: null,\n texture: null,\n textureColor: 'black',\n textureSize: 10,\n texturePadding: 2,\n backgroundMode: 0,\n blur: 0,\n cursor: null,\n ...DefaultFillStyle,\n ...DefaultStrokeStyle\n};\n\nexport const DefaultAttribute: Required<IGraphicAttribute> = {\n strokeSeg: null,\n pickable: true,\n childrenPickable: true,\n visible: true,\n zIndex: 0,\n layout: null,\n boundsPadding: 0,\n pickMode: 'accurate',\n customPickShape: null,\n boundsMode: 'accurate',\n keepDirIn3d: true,\n ...DefaultStyle,\n ...DefaultTransform\n};\n\nexport function addAttributeToPrototype(obj: Record<string, any>, c: any, keys: string[]) {\n keys.forEach(key => {\n c.prototype[key] = obj[key];\n });\n}\nexport function rewriteProto(obj: Record<string, any>, c: Record<string, any>) {\n Object.setPrototypeOf(obj, c);\n}\n\nexport const DefaultArcAttribute: Required<IArcGraphicAttribute> = {\n ...DefaultAttribute,\n startAngle: 0,\n endAngle: pi2,\n innerRadius: 0,\n outerRadius: 1,\n cornerRadius: 0,\n padRadius: 0,\n padAngle: 0,\n cap: false,\n forceShowCap: false\n};\n\nexport const DefaultAreaAttribute: Required<IAreaGraphicAttribute> = {\n ...DefaultAttribute,\n points: [],\n segments: [],\n curveType: 'linear',\n clipRange: 1\n};\n\nexport const DefaultCircleAttribute: Required<ICircleGraphicAttribute> = {\n ...DefaultAttribute,\n radius: 1,\n startAngle: 0,\n endAngle: pi2\n};\n\nexport const DefaultGroupAttribute: Required<IGroupGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n cornerRadius: 0,\n path: [],\n clip: false,\n visibleAll: true\n};\n\nexport const DefaultGlyphAttribute: Required<IGlyphGraphicAttribute> = {\n ...DefaultAttribute,\n path: '',\n width: 0,\n height: 0,\n cornerRadius: 0,\n clip: false\n};\n\nexport const DefaultLineAttribute: Required<ILineGraphicAttribute> = {\n ...DefaultAttribute,\n points: [],\n segments: [],\n curveType: 'linear',\n clipRange: 1,\n clipRangeByDimension: 'default'\n};\n\nexport const DefaultPathAttribute: Required<IPathGraphicAttribute> = {\n ...DefaultAttribute,\n path: new CustomPath2D(),\n customPath: () => {\n console.warn('空函数');\n }\n};\n\nexport const DefaultPolygonAttribute: Required<IPolygonGraphicAttribute> = {\n ...DefaultAttribute,\n points: [],\n cornerRadius: 0\n};\n\nexport const DefaultRectAttribute: Required<IRectGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n strokeBoundsBuffer: 0,\n cornerRadius: 0\n};\n\nexport const DefaultRect3dAttribute: Required<IRect3dGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n cornerRadius: 0,\n length: 0\n};\n\nexport const DefaultSymbolAttribute: Required<ISymbolGraphicAttribute> = {\n ...DefaultAttribute,\n symbolType: 'circle',\n size: 10, // 外接**正方形**的边长\n keepDirIn3d: true\n};\n\nexport const DefaultTextAttribute: Required<ITextGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultTextStyle,\n strokeBoundsBuffer: 0,\n keepDirIn3d: true\n};\n\nexport const DefaultRichTextAttribute: Required<IRichTextGraphicAttribute> = {\n ...DefaultAttribute,\n width: 300,\n height: 300,\n ellipsis: true,\n wordBreak: 'break-word' as RichTextWordBreak,\n verticalDirection: 'top' as RichTextVerticalDirection,\n textAlign: 'left' as RichTextGlobalAlignType,\n textBaseline: 'top' as RichTextGlobalBaselineType,\n layoutDirection: 'horizontal',\n textConfig: [],\n maxHeight: undefined,\n maxWidth: undefined,\n singleLine: false\n};\n\nexport const DefaultImageAttribute: Required<IImageGraphicAttribute> = {\n repeatX: 'stretch',\n repeatY: 'stretch',\n image: '',\n width: 0,\n height: 0,\n ...DefaultAttribute,\n fill: true\n};\n\nexport const DefaultRichTextIconAttribute: Required<IRichTextIconGraphicAttribute> = {\n ...DefaultImageAttribute,\n backgroundShowMode: 'never',\n backgroundWidth: 0,\n backgroundHeight: 0,\n textAlign: 'left',\n textBaseline: 'middle',\n direction: 'horizontal',\n margin: 0,\n id: '',\n\n width: 20,\n height: 20,\n backgroundFill: 'rgba(101, 117, 168, 0.1)',\n backgroundFillOpacity: 1,\n backgroundStroke: false,\n backgroundStrokeOpacity: 1,\n backgroundRadius: 4,\n opacity: 1\n};\n"]}
1
+ {"version":3,"sources":["../../src/graphic/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AA6BvD,MAAM,CAAC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AAE,IAAI,GACX,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,mCACpC,qBAAqB,KACxB,kBAAkB,EAAE,OAAO,EAC3B,eAAe,EAAE,CAAC,EAClB,gBAAgB,EAAE,CAAC,EACnB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,QAAQ,EACtB,SAAS,EAAE,YAAY,EACvB,MAAM,EAAE,CAAC,EACT,EAAE,EAAE,EAAE,EAEN,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,EACV,cAAc,EAAE,0BAA0B,EAC1C,qBAAqB,EAAE,CAAC,EACxB,gBAAgB,EAAE,KAAK,EACvB,uBAAuB,EAAE,CAAC,EAC1B,gBAAgB,EAAE,CAAC,EACnB,OAAO,EAAE,CAAC,GACX,CAAC","file":"config.js","sourcesContent":["// 存放公共属性\nimport { Matrix, pi2 } from '@visactor/vutils';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport {\n IArcGraphicAttribute,\n IAreaGraphicAttribute,\n IGraphicAttribute,\n ICircleGraphicAttribute,\n IFillStyle,\n IGlyphGraphicAttribute,\n IGroupGraphicAttribute,\n IImageGraphicAttribute,\n ILineGraphicAttribute,\n IPathGraphicAttribute,\n IPolygonGraphicAttribute,\n IRect3dGraphicAttribute,\n IRectGraphicAttribute,\n IStrokeStyle,\n IGraphicStyle,\n ISymbolGraphicAttribute,\n ITextAttribute,\n ITextGraphicAttribute,\n IRichTextGraphicAttribute,\n ITransform,\n RichTextWordBreak,\n RichTextVerticalDirection,\n RichTextGlobalAlignType,\n RichTextGlobalBaselineType,\n IRichTextIconGraphicAttribute\n} from '../interface';\n\nexport const DefaultTransform: ITransform = {\n x: 0,\n y: 0,\n z: 0,\n dx: 0,\n dy: 0,\n dz: 0,\n scrollX: 0,\n scrollY: 0,\n scaleX: 1,\n scaleY: 1,\n scaleZ: 1,\n angle: 0,\n alpha: 0,\n beta: 0,\n anchor: [0, 0],\n anchor3d: [0, 0],\n postMatrix: new Matrix()\n};\n\nexport const DefaultFillStyle: IFillStyle = {\n fillOpacity: 1,\n fill: false,\n shadowBlur: 0,\n shadowColor: 'black',\n shadowOffsetX: 0,\n shadowOffsetY: 0\n};\n\nconst commonStroke: Omit<IStrokeStyle, 'outerBorder' | 'innerBorder'> = {\n strokeOpacity: 1,\n lineDash: [],\n lineDashOffset: 0,\n lineWidth: 1,\n lineCap: 'butt',\n lineJoin: 'miter',\n miterLimit: 10,\n strokeBoundsBuffer: 2,\n stroke: false\n};\n\nexport const DefaultStrokeStyle: IStrokeStyle = {\n outerBorder: { ...commonStroke, distance: 0 },\n innerBorder: { ...commonStroke, distance: 0 },\n ...commonStroke\n};\n\nexport const DefaultTextStyle: Required<ITextAttribute> = {\n text: '',\n maxLineWidth: Infinity,\n textAlign: 'left',\n textBaseline: 'alphabetic',\n fontSize: 16,\n // @ts-ignore\n fontFamily: `PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol`,\n fontWeight: '',\n ellipsis: '…',\n fontVariant: '',\n fontStyle: '',\n lineHeight: undefined,\n underline: 0,\n lineThrough: 0\n};\n\nexport const DefaultStyle: IGraphicStyle = {\n opacity: 1,\n background: null,\n texture: null,\n textureColor: 'black',\n textureSize: 10,\n texturePadding: 2,\n backgroundMode: 0,\n blur: 0,\n cursor: null,\n ...DefaultFillStyle,\n ...DefaultStrokeStyle\n};\n\nexport const DefaultAttribute: Required<IGraphicAttribute> = {\n strokeSeg: null,\n pickable: true,\n childrenPickable: true,\n visible: true,\n zIndex: 0,\n layout: null,\n boundsPadding: 0,\n pickMode: 'accurate',\n customPickShape: null,\n boundsMode: 'accurate',\n keepDirIn3d: true,\n ...DefaultStyle,\n ...DefaultTransform\n};\n\nexport function addAttributeToPrototype(obj: Record<string, any>, c: any, keys: string[]) {\n keys.forEach(key => {\n c.prototype[key] = obj[key];\n });\n}\nexport function rewriteProto(obj: Record<string, any>, c: Record<string, any>) {\n Object.setPrototypeOf(obj, c);\n}\n\nexport const DefaultArcAttribute: Required<IArcGraphicAttribute> = {\n ...DefaultAttribute,\n startAngle: 0,\n endAngle: pi2,\n innerRadius: 0,\n outerRadius: 1,\n cornerRadius: 0,\n padRadius: 0,\n padAngle: 0,\n cap: false,\n forceShowCap: false\n};\n\nexport const DefaultAreaAttribute: Required<IAreaGraphicAttribute> = {\n ...DefaultAttribute,\n points: [],\n segments: [],\n curveType: 'linear',\n clipRange: 1\n};\n\nexport const DefaultCircleAttribute: Required<ICircleGraphicAttribute> = {\n ...DefaultAttribute,\n radius: 1,\n startAngle: 0,\n endAngle: pi2\n};\n\nexport const DefaultGroupAttribute: Required<IGroupGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n cornerRadius: 0,\n path: [],\n clip: false,\n visibleAll: true\n};\n\nexport const DefaultGlyphAttribute: Required<IGlyphGraphicAttribute> = {\n ...DefaultAttribute,\n path: '',\n width: 0,\n height: 0,\n cornerRadius: 0,\n clip: false\n};\n\nexport const DefaultLineAttribute: Required<ILineGraphicAttribute> = {\n ...DefaultAttribute,\n points: [],\n segments: [],\n curveType: 'linear',\n clipRange: 1,\n clipRangeByDimension: 'default'\n};\n\nexport const DefaultPathAttribute: Required<IPathGraphicAttribute> = {\n ...DefaultAttribute,\n path: new CustomPath2D(),\n customPath: () => {\n console.warn('空函数');\n }\n};\n\nexport const DefaultPolygonAttribute: Required<IPolygonGraphicAttribute> = {\n ...DefaultAttribute,\n points: [],\n cornerRadius: 0\n};\n\nexport const DefaultRectAttribute: Required<IRectGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n cornerRadius: 0\n};\n\nexport const DefaultRect3dAttribute: Required<IRect3dGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n cornerRadius: 0,\n length: 0\n};\n\nexport const DefaultSymbolAttribute: Required<ISymbolGraphicAttribute> = {\n ...DefaultAttribute,\n symbolType: 'circle',\n size: 10, // 外接**正方形**的边长\n keepDirIn3d: true\n};\n\nexport const DefaultTextAttribute: Required<ITextGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultTextStyle,\n strokeBoundsBuffer: 0,\n keepDirIn3d: true\n};\n\nexport const DefaultRichTextAttribute: Required<IRichTextGraphicAttribute> = {\n ...DefaultAttribute,\n width: 300,\n height: 300,\n ellipsis: true,\n wordBreak: 'break-word' as RichTextWordBreak,\n verticalDirection: 'top' as RichTextVerticalDirection,\n textAlign: 'left' as RichTextGlobalAlignType,\n textBaseline: 'top' as RichTextGlobalBaselineType,\n layoutDirection: 'horizontal',\n textConfig: [],\n maxHeight: undefined,\n maxWidth: undefined,\n singleLine: false\n};\n\nexport const DefaultImageAttribute: Required<IImageGraphicAttribute> = {\n repeatX: 'stretch',\n repeatY: 'stretch',\n image: '',\n width: 0,\n height: 0,\n ...DefaultAttribute,\n fill: true\n};\n\nexport const DefaultRichTextIconAttribute: Required<IRichTextIconGraphicAttribute> = {\n ...DefaultImageAttribute,\n backgroundShowMode: 'never',\n backgroundWidth: 0,\n backgroundHeight: 0,\n textAlign: 'left',\n textBaseline: 'middle',\n direction: 'horizontal',\n margin: 0,\n id: '',\n\n width: 20,\n height: 20,\n backgroundFill: 'rgba(101, 117, 168, 0.1)',\n backgroundFillOpacity: 1,\n backgroundStroke: false,\n backgroundStrokeOpacity: 1,\n backgroundRadius: 4,\n opacity: 1\n};\n"]}
@@ -80,5 +80,5 @@ export declare class DefaultGraphicService implements IGraphicService {
80
80
  updateSymbolAABBBoundsAccurate(attribute: ISymbolGraphicAttribute, symbolTheme: Required<ISymbolGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: ISymbol): IAABBBounds;
81
81
  updateImageAABBBounds(attribute: IImageGraphicAttribute, imageTheme: Required<IImageGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IGraphic): IBounds;
82
82
  combindShadowAABBBounds(bounds: IAABBBounds, graphic?: IGraphic): void;
83
- transformAABBBounds(attribute: Partial<IGraphicAttribute>, aabbBounds: IAABBBounds, theme: Required<IGraphicAttribute>, miter: boolean, graphic?: IGraphic): void;
83
+ transformAABBBounds(attribute: Partial<IGraphicAttribute>, aabbBounds: IAABBBounds, theme: Required<IGraphicAttribute>, graphic?: IGraphic): void;
84
84
  }
@@ -247,7 +247,7 @@ let DefaultGraphicService = class {
247
247
  tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this._rectBoundsContribitions || (this._rectBoundsContribitions = this.rectBoundsContribitions.getContributions() || []),
248
248
  this._rectBoundsContribitions.length && this._rectBoundsContribitions.forEach((c => {
249
249
  c.updateBounds(attribute, rectTheme, tb1, graphic), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
250
- })), this.transformAABBBounds(attribute, aabbBounds, rectTheme, !1, graphic), aabbBounds;
250
+ })), this.transformAABBBounds(attribute, aabbBounds, rectTheme, graphic), aabbBounds;
251
251
  }
252
252
  updateGroupAABBBounds(attribute, groupTheme, aabbBounds, graphic) {
253
253
  const {width: width, height: height, path: path, clip: clip = groupTheme.clip} = attribute;
@@ -258,7 +258,7 @@ let DefaultGraphicService = class {
258
258
  }));
259
259
  const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
260
260
  return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2),
261
- tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this.transformAABBBounds(attribute, aabbBounds, groupTheme, !1, graphic),
261
+ tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this.transformAABBBounds(attribute, aabbBounds, groupTheme, graphic),
262
262
  aabbBounds;
263
263
  }
264
264
  updateGlyphAABBBounds(attribute, theme, aabbBounds, graphic) {
@@ -305,7 +305,7 @@ let DefaultGraphicService = class {
305
305
  aabbBounds.translate(deltaX, deltaY);
306
306
  const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
307
307
  return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2),
308
- tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this.transformAABBBounds(attribute, aabbBounds, richtextTheme, !1, graphic),
308
+ tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this.transformAABBBounds(attribute, aabbBounds, richtextTheme, graphic),
309
309
  aabbBounds;
310
310
  }
311
311
  updateTextAABBBounds(attribute, textTheme, aabbBounds, graphic) {
@@ -320,14 +320,11 @@ let DefaultGraphicService = class {
320
320
  updatePathAABBBounds(attribute, pathTheme, aabbBounds, graphic) {
321
321
  this.updatePathProxyAABBBounds(aabbBounds, graphic) || this.updatePathAABBBoundsImprecise(attribute, pathTheme, aabbBounds, graphic);
322
322
  const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
323
- tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2),
324
- this._pathBoundsContribitions || (this._pathBoundsContribitions = this.pathBoundsContribitions.getContributions() || []),
323
+ return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2),
324
+ tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this._pathBoundsContribitions || (this._pathBoundsContribitions = this.pathBoundsContribitions.getContributions() || []),
325
325
  this._pathBoundsContribitions.length && this._pathBoundsContribitions.forEach((c => {
326
326
  c.updateBounds(attribute, pathTheme, tb1, graphic), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
327
- }));
328
- const {lineJoin: lineJoin = pathTheme.lineJoin} = attribute;
329
- return this.transformAABBBounds(attribute, aabbBounds, pathTheme, "miter" === lineJoin, graphic),
330
- aabbBounds;
327
+ })), this.transformAABBBounds(attribute, aabbBounds, pathTheme, graphic), aabbBounds;
331
328
  }
332
329
  updatePathAABBBoundsImprecise(attribute, pathTheme, aabbBounds, graphic) {
333
330
  if (!graphic) return aabbBounds;
@@ -344,7 +341,7 @@ let DefaultGraphicService = class {
344
341
  }));
345
342
  const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
346
343
  return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2),
347
- tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this.transformAABBBounds(attribute, aabbBounds, polygonTheme, !1, graphic),
344
+ tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this.transformAABBBounds(attribute, aabbBounds, polygonTheme, graphic),
348
345
  aabbBounds;
349
346
  }
350
347
  updateArc3dAABBBounds(attribute, arcTheme, aabbBounds, graphic) {
@@ -355,15 +352,14 @@ let DefaultGraphicService = class {
355
352
  aabbBounds.setValue(-r, -r, r, r);
356
353
  const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
357
354
  return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2),
358
- tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this.transformAABBBounds(attribute, aabbBounds, arcTheme, !1, graphic),
355
+ tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this.transformAABBBounds(attribute, aabbBounds, arcTheme, graphic),
359
356
  aabbBounds;
360
357
  }
361
358
  updatePolygonAABBBounds(attribute, polygonTheme, aabbBounds, graphic) {
362
359
  this.updatePathProxyAABBBounds(aabbBounds, graphic) || this.updatePolygonAABBBoundsImprecise(attribute, polygonTheme, aabbBounds, graphic);
363
360
  const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
364
- tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2);
365
- const {lineJoin: lineJoin = polygonTheme.lineJoin} = attribute;
366
- return this.transformAABBBounds(attribute, aabbBounds, polygonTheme, "miter" === lineJoin, graphic),
361
+ return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2),
362
+ tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this.transformAABBBounds(attribute, aabbBounds, polygonTheme, graphic),
367
363
  aabbBounds;
368
364
  }
369
365
  updatePolygonAABBBoundsImprecise(attribute, polygonTheme, aabbBounds, graphic) {
@@ -375,9 +371,8 @@ let DefaultGraphicService = class {
375
371
  updateLineAABBBounds(attribute, lineTheme, aabbBounds, graphic) {
376
372
  this.updatePathProxyAABBBounds(aabbBounds, graphic) || (attribute.segments ? this.updateLineAABBBoundsBySegments(attribute, lineTheme, aabbBounds, graphic) : this.updateLineAABBBoundsByPoints(attribute, lineTheme, aabbBounds, graphic));
377
373
  const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
378
- tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2);
379
- const {lineJoin: lineJoin = lineTheme.lineJoin} = attribute;
380
- return this.transformAABBBounds(attribute, aabbBounds, lineTheme, "miter" === lineJoin, graphic),
374
+ return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2),
375
+ tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this.transformAABBBounds(attribute, aabbBounds, lineTheme, graphic),
381
376
  aabbBounds;
382
377
  }
383
378
  updateLineAABBBoundsByPoints(attribute, lineTheme, aabbBounds, graphic) {
@@ -397,9 +392,8 @@ let DefaultGraphicService = class {
397
392
  updateAreaAABBBounds(attribute, areaTheme, aabbBounds, graphic) {
398
393
  this.updatePathProxyAABBBounds(aabbBounds, graphic) || (attribute.segments ? this.updateAreaAABBBoundsBySegments(attribute, areaTheme, aabbBounds, graphic) : this.updateAreaAABBBoundsByPoints(attribute, areaTheme, aabbBounds, graphic));
399
394
  const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
400
- tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2);
401
- const {lineJoin: lineJoin = areaTheme.lineJoin} = attribute;
402
- return this.transformAABBBounds(attribute, aabbBounds, areaTheme, "miter" === lineJoin, graphic),
395
+ return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2),
396
+ tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this.transformAABBBounds(attribute, aabbBounds, areaTheme, graphic),
403
397
  aabbBounds;
404
398
  }
405
399
  updateAreaAABBBoundsByPoints(attribute, areaTheme, aabbBounds, graphic) {
@@ -425,8 +419,7 @@ let DefaultGraphicService = class {
425
419
  tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this._circleBoundsContribitions || (this._circleBoundsContribitions = this.circleBoundsContribitions.getContributions() || []),
426
420
  this._circleBoundsContribitions.length && this._circleBoundsContribitions.forEach((c => {
427
421
  c.updateBounds(attribute, circleTheme, tb1, graphic), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
428
- })), this.transformAABBBounds(attribute, aabbBounds, circleTheme, !1, graphic),
429
- aabbBounds;
422
+ })), this.transformAABBBounds(attribute, aabbBounds, circleTheme, graphic), aabbBounds;
430
423
  }
431
424
  updateCircleAABBBoundsImprecise(attribute, circleTheme, aabbBounds, graphic) {
432
425
  const {radius: radius = circleTheme.radius} = attribute;
@@ -440,14 +433,11 @@ let DefaultGraphicService = class {
440
433
  updateArcAABBBounds(attribute, arcTheme, aabbBounds, full, graphic) {
441
434
  this.updatePathProxyAABBBounds(aabbBounds, graphic) || (full ? this.updateArcAABBBoundsImprecise(attribute, arcTheme, aabbBounds, graphic) : this.updateArcAABBBoundsAccurate(attribute, arcTheme, aabbBounds, graphic));
442
435
  const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
443
- tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2),
444
- this._arcBoundsContribitions || (this._arcBoundsContribitions = this.arcBoundsContribitions.getContributions() || []),
436
+ return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2),
437
+ tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this._arcBoundsContribitions || (this._arcBoundsContribitions = this.arcBoundsContribitions.getContributions() || []),
445
438
  this._arcBoundsContribitions.length && this._arcBoundsContribitions.forEach((c => {
446
439
  c.updateBounds(attribute, arcTheme, tb1, graphic), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
447
- }));
448
- const {lineJoin: lineJoin = arcTheme.lineJoin} = attribute;
449
- return this.transformAABBBounds(attribute, aabbBounds, arcTheme, "miter" === lineJoin, graphic),
450
- aabbBounds;
440
+ })), this.transformAABBBounds(attribute, aabbBounds, arcTheme, graphic), aabbBounds;
451
441
  }
452
442
  updateArcAABBBoundsImprecise(attribute, arcTheme, aabbBounds, graphic) {
453
443
  const {outerRadius: outerRadius = arcTheme.outerRadius} = attribute;
@@ -461,14 +451,11 @@ let DefaultGraphicService = class {
461
451
  updateSymbolAABBBounds(attribute, symbolTheme, aabbBounds, full, graphic) {
462
452
  this.updatePathProxyAABBBounds(aabbBounds, graphic) || (full ? this.updateSymbolAABBBoundsImprecise(attribute, symbolTheme, aabbBounds, graphic) : this.updateSymbolAABBBoundsAccurate(attribute, symbolTheme, aabbBounds, graphic));
463
453
  const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
464
- tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2),
465
- this._symbolBoundsContribitions || (this._symbolBoundsContribitions = this.symbolBoundsContribitions.getContributions() || []),
454
+ return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2),
455
+ tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this._symbolBoundsContribitions || (this._symbolBoundsContribitions = this.symbolBoundsContribitions.getContributions() || []),
466
456
  this._symbolBoundsContribitions.length && this._symbolBoundsContribitions.forEach((c => {
467
457
  c.updateBounds(attribute, symbolTheme, tb1, graphic), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
468
- }));
469
- const {lineJoin: lineJoin = symbolTheme.lineJoin} = attribute;
470
- return this.transformAABBBounds(attribute, aabbBounds, symbolTheme, "miter" === lineJoin, graphic),
471
- aabbBounds;
458
+ })), this.transformAABBBounds(attribute, aabbBounds, symbolTheme, graphic), aabbBounds;
472
459
  }
473
460
  updateSymbolAABBBoundsImprecise(attribute, symbolTheme, aabbBounds, graphic) {
474
461
  const {size: size = symbolTheme.size} = attribute;
@@ -490,7 +477,7 @@ let DefaultGraphicService = class {
490
477
  }
491
478
  const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
492
479
  return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2),
493
- tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this.transformAABBBounds(attribute, aabbBounds, imageTheme, !1, graphic),
480
+ tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this.transformAABBBounds(attribute, aabbBounds, imageTheme, graphic),
494
481
  aabbBounds;
495
482
  }
496
483
  combindShadowAABBBounds(bounds, graphic) {
@@ -499,16 +486,17 @@ let DefaultGraphicService = class {
499
486
  bounds.union(b);
500
487
  }
501
488
  }
502
- transformAABBBounds(attribute, aabbBounds, theme, miter, graphic) {
503
- const {scaleX: scaleX = theme.scaleX, scaleY: scaleY = theme.scaleY, stroke: stroke = theme.stroke, shadowBlur: shadowBlur = theme.shadowBlur, lineWidth: lineWidth = theme.lineWidth, strokeBoundsBuffer: strokeBoundsBuffer = theme.strokeBoundsBuffer} = attribute, tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
489
+ transformAABBBounds(attribute, aabbBounds, theme, graphic) {
490
+ const {scaleX: scaleX = theme.scaleX, scaleY: scaleY = theme.scaleY, stroke: stroke = theme.stroke, shadowBlur: shadowBlur = theme.shadowBlur, lineWidth: lineWidth = theme.lineWidth, lineJoin: lineJoin = theme.lineJoin, strokeBoundsBuffer: strokeBoundsBuffer = theme.strokeBoundsBuffer} = attribute, tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
504
491
  if (stroke) {
505
492
  const scaledHalfLineWidth = lineWidth / Math.abs(scaleX + scaleY);
506
- boundStroke(tb1, scaledHalfLineWidth, miter, strokeBoundsBuffer), aabbBounds.union(tb1),
507
- tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
493
+ boundStroke(tb1, scaledHalfLineWidth, "miter" === lineJoin, strokeBoundsBuffer),
494
+ aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
508
495
  }
509
496
  if (shadowBlur) {
510
497
  const shadowBlurHalfWidth = shadowBlur / Math.abs(scaleX + scaleY);
511
- boundStroke(tb1, shadowBlurHalfWidth, miter, strokeBoundsBuffer), aabbBounds.union(tb1);
498
+ boundStroke(tb1, shadowBlurHalfWidth, "miter" === lineJoin, strokeBoundsBuffer),
499
+ aabbBounds.union(tb1);
512
500
  }
513
501
  this.combindShadowAABBBounds(aabbBounds, graphic), transformBoundsWithMatrix(aabbBounds, aabbBounds, graphic.transMatrix);
514
502
  }