From 1d5221dffb4d8a3e1f87bb4887d601384b610c83 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Mon, 22 Jan 2024 15:54:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=BA=E6=99=AF=E7=94=BB=E5=B8=83=E7=BC=A9?= =?UTF-8?q?=E6=94=BE=E7=9B=91=E5=90=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/index.js | 4 ++-- package.json | 2 +- src/graphic/VectorGraphic.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/index.js b/lib/index.js index 0497a97..ad87389 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1226,12 +1226,12 @@ class VectorGraphicUtil { const registerScaleChange = function registerScaleChange(obj) { if (!obj.scaledListenerOn) { obj.scaledListenerOn = true; - obj.getGraphicApp().on('viewport-scaled', onScaleChange); + obj.getCanvas().scene.on('viewport-scaled', onScaleChange); } }; const unregisterScaleChange = function unregisterScaleChange(obj) { obj.scaledListenerOn = false; - obj.getGraphicApp().off('viewport-scaled', onScaleChange); + obj.getCanvas().scene.off('viewport-scaled', onScaleChange); }; obj.onAddToCanvas = function onAddToCanvas() { obj.updateOnScaled(); diff --git a/package.json b/package.json index 81147b5..71f8088 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "graphic-pixi", - "version": "0.1.8", + "version": "0.1.9", "description": "基于pixijs的图形应用、绘制应用框架", "productName": "Graphic-pixi", "author": "walker ", diff --git a/src/graphic/VectorGraphic.ts b/src/graphic/VectorGraphic.ts index d6c057c..d479182 100644 --- a/src/graphic/VectorGraphic.ts +++ b/src/graphic/VectorGraphic.ts @@ -18,14 +18,14 @@ export class VectorGraphicUtil { ): void { if (!obj.scaledListenerOn) { obj.scaledListenerOn = true; - obj.getGraphicApp().on('viewport-scaled', onScaleChange); + obj.getCanvas().scene.on('viewport-scaled', onScaleChange); } }; const unregisterScaleChange = function unregisterScaleChange( obj: VectorGraphic ): void { obj.scaledListenerOn = false; - obj.getGraphicApp().off('viewport-scaled', onScaleChange); + obj.getCanvas().scene.off('viewport-scaled', onScaleChange); }; obj.onAddToCanvas = function onAddToCanvas() { obj.updateOnScaled();