From 76e08d066a932c402e0acc57c22d8aed4bc9b3b4 Mon Sep 17 00:00:00 2001 From: ai-qing-hai <65594180+ai-qing-hai@users.noreply.github.com> Date: Mon, 31 May 2021 14:57:53 +0800 Subject: [PATCH] =?UTF-8?q?=20fix:=20=E4=BF=AE=E5=A4=8D=20view.changeData?= =?UTF-8?q?=20=E5=9C=A8=E9=87=8D=E6=96=B0=E6=B8=B2=E6=9F=93=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=20=E6=8A=A5=20toFront=20=E4=B8=BA=20underfin?= =?UTF-8?q?d=20=E7=9A=84=E9=94=99=E8=AF=AF=20(#3438)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 修复 view.changeData 在重新渲染的时候 报 toFront 为 underfind 的错误 * fix:修改 判断 toBack/toFront underfind 的判断方法 Co-authored-by: wb-xcf804241 --- src/geometry/element/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/geometry/element/index.ts b/src/geometry/element/index.ts index e357c85500..5f26ec7ed7 100644 --- a/src/geometry/element/index.ts +++ b/src/geometry/element/index.ts @@ -215,7 +215,7 @@ export default class Element extends Base { } states.push(stateName); if (stateName === 'active' || stateName === 'selected') { - shape.toFront(); + shape?.toFront(); } } else { if (index === -1) { @@ -224,7 +224,7 @@ export default class Element extends Base { } states.splice(index, 1); if (stateName === 'active' || stateName === 'selected') { - shape.toBack(); + shape?.toBack(); } }