From 473225145db0245ae9c22303675f7a70ddcf9fc8 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Thu, 25 Jan 2024 09:56:33 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9F=A2=E9=87=8F=E6=96=87=E5=AD=97=E4=BF=AE?= =?UTF-8?q?=E6=94=B9---=E8=A7=A3=E5=86=B3=E5=B1=8F=E8=94=BD=E9=97=A8?= =?UTF-8?q?=E5=AD=90=E5=85=83=E7=B4=A0=E5=AD=97=E4=BD=93=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=8F=98=E5=A4=A7=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/index.js | 8 +++++--- package.json | 2 +- src/graphic/VectorGraphic.ts | 8 +++++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/index.js b/lib/index.js index ad87389..4b49821 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1242,9 +1242,11 @@ class VectorGraphicUtil { unregisterScaleChange(obj); }; obj.on('added', (container) => { - if (container.isInCanvas()) { - obj.onAddToCanvas(container.getCanvas()); - } + setTimeout(() => { + if (container.isInCanvas()) { + obj.onAddToCanvas(container.getCanvas()); + } + }, 0); }); } } diff --git a/package.json b/package.json index 71f8088..f692b74 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "graphic-pixi", - "version": "0.1.9", + "version": "0.1.10", "description": "基于pixijs的图形应用、绘制应用框架", "productName": "Graphic-pixi", "author": "walker ", diff --git a/src/graphic/VectorGraphic.ts b/src/graphic/VectorGraphic.ts index d479182..4e89597 100644 --- a/src/graphic/VectorGraphic.ts +++ b/src/graphic/VectorGraphic.ts @@ -37,9 +37,11 @@ export class VectorGraphicUtil { }; obj.on('added', (container) => { - if (container.isInCanvas()) { - obj.onAddToCanvas(container.getCanvas()); - } + setTimeout(() => { + if (container.isInCanvas()) { + obj.onAddToCanvas(container.getCanvas()); + } + }, 0); }); } }