Skip to content

Commit

Permalink
fix: Error when lineJoin is set to round (Orillusion#366)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
hellmor authored Mar 21, 2024
1 parent 7ab2f48 commit 1ab8718
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/graphic/compute/shape3d/Path2DShape3DCode_cs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -442,10 +442,10 @@ fn drawPath2DCorner(shapeData:Path2DShape3D, currentPoint:Path3DKeyPoint){
var rotateFrom:vec3<f32>;
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;
Expand Down
2 changes: 1 addition & 1 deletion src/components/gui/uiComponents/UITransform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit 1ab8718

Please sign in to comment.