From 1ab87183c6910c2fc3e61d940b0183a2d5597b08 Mon Sep 17 00:00:00 2001 From: hellmor Date: Thu, 21 Mar 2024 20:36:23 +0800 Subject: [PATCH] fix: Error when lineJoin is set to round (#366) * fix: Error when lineJoin is set to round Fix error when lineJoin is set to round. * fix: Remove eventListener. Remove the eventListener when transform is disposed. --- packages/graphic/compute/shape3d/Path2DShape3DCode_cs.ts | 4 ++-- src/components/gui/uiComponents/UITransform.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/graphic/compute/shape3d/Path2DShape3DCode_cs.ts b/packages/graphic/compute/shape3d/Path2DShape3DCode_cs.ts index 197b5039..f1dc6e6d 100644 --- a/packages/graphic/compute/shape3d/Path2DShape3DCode_cs.ts +++ b/packages/graphic/compute/shape3d/Path2DShape3DCode_cs.ts @@ -442,10 +442,10 @@ fn drawPath2DCorner(shapeData:Path2DShape3D, currentPoint:Path3DKeyPoint){ var rotateFrom:vec3; if(isPositive){ rotateFrom = -prevPoint.right; - rotateMat = buildRotateZ(-cornerAngle * 2.0 / f32(cornerPointExt)); + rotateMat = buildRotateYMat3(-cornerAngle * 2.0 / f32(cornerPointExt)); }else{ rotateFrom = prevPoint.right; - rotateMat = buildRotateZ(cornerAngle * 2.0 / f32(cornerPointExt)); + rotateMat = buildRotateYMat3(cornerAngle * 2.0 / f32(cornerPointExt)); } tempV = currentPoint.overallLength - cornerUVLength * lastLengthUVRatio; diff --git a/src/components/gui/uiComponents/UITransform.ts b/src/components/gui/uiComponents/UITransform.ts index ba0a6294..8269e36f 100644 --- a/src/components/gui/uiComponents/UITransform.ts +++ b/src/components/gui/uiComponents/UITransform.ts @@ -298,7 +298,7 @@ export class UITransform extends ComponentBase { } public beforeDestroy(force?: boolean): void { - this.transform.eventDispatcher.addEventListener(this.transform.eventLocalChange.type, this.onTransformChange, this); + this.transform.eventDispatcher.removeEventListener(this.transform.eventLocalChange.type, this.onTransformChange, this); super.beforeDestroy?.(force); } }