From 56afed3129494932fbfd14627051b569a71dc288 Mon Sep 17 00:00:00 2001 From: zhouxinyu Date: Fri, 12 Jan 2024 18:27:43 +0800 Subject: [PATCH] fix: fix issue with shadow bounds --- .../src/graphic/graphic-service/graphic-service.ts | 8 +++++--- packages/vrender-core/src/graphic/graphic.ts | 13 ++++++------- packages/vrender-core/src/graphic/shadow-root.ts | 10 +++------- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/packages/vrender-core/src/graphic/graphic-service/graphic-service.ts b/packages/vrender-core/src/graphic/graphic-service/graphic-service.ts index 33099810d..3219aed70 100644 --- a/packages/vrender-core/src/graphic/graphic-service/graphic-service.ts +++ b/packages/vrender-core/src/graphic/graphic-service/graphic-service.ts @@ -719,9 +719,11 @@ export class DefaultGraphicService implements IGraphicService { graphic?: IGraphic ) { if (!this._validCheck(attribute, rectTheme, aabbBounds, graphic)) { - return aabbBounds; - } - if (!this.updatePathProxyAABBBounds(aabbBounds, graphic)) { + aabbBounds.clear(); + if (!graphic.shadowRoot) { + return aabbBounds; + } + } else if (!this.updatePathProxyAABBBounds(aabbBounds, graphic)) { let { width, height } = attribute; const { x1, y1, x, y } = attribute; width = width ?? x1 - x; diff --git a/packages/vrender-core/src/graphic/graphic.ts b/packages/vrender-core/src/graphic/graphic.ts index 0c8a5b7b3..e1950b808 100644 --- a/packages/vrender-core/src/graphic/graphic.ts +++ b/packages/vrender-core/src/graphic/graphic.ts @@ -331,15 +331,11 @@ export abstract class Graphic = Partial = Partial