@@ -1075,31 +1075,25 @@ export class CoreNode extends EventEmitter {
10751075
10761076 let renderState : CoreNodeRenderState | null = null ;
10771077
1078- if (
1079- updateType & UpdateType . Local ||
1080- this . updateType & UpdateType . ScaleRotate
1081- ) {
1078+ if ( updateType & UpdateType . Local || updateType & UpdateType . ScaleRotate ) {
10821079 this . updateLocalTransform ( {
10831080 scaleRotate : ( updateType & UpdateType . ScaleRotate ) !== 0 ,
10841081 } ) ;
10851082
1086- // this.setUpdateType(UpdateType.Global);
10871083 updateType |= UpdateType . Global ;
10881084 }
10891085
10901086 if ( updateType & UpdateType . Global ) {
10911087 // global
10921088 let lt = this . localTransform || Matrix3d . identity ( ) ;
1093- let gt = this . globalTransform || Matrix3d . identity ( ) ;
1089+ let gt = this . globalTransform || Matrix3d . copy ( lt ) ;
10941090
10951091 if ( parentHasRenderTexture === true ) {
10961092 if ( parent ?. rtt === true ) {
10971093 this . globalTransform = Matrix3d . identity ( ) ;
10981094
10991095 // Maintain a full scene global transform for bounds detection
1100- this . sceneGlobalTransform = Matrix3d . copy (
1101- parent ?. globalTransform || Matrix3d . identity ( ) ,
1102- ) . multiply ( lt ) ;
1096+ this . sceneGlobalTransform = Matrix3d . copy ( gt ) . multiply ( lt ) ;
11031097 } else {
11041098 // we're part of an RTT chain but our parent is not the main RTT node
11051099 // so we need to propogate the sceneGlobalTransform of the parent
@@ -1109,7 +1103,7 @@ export class CoreNode extends EventEmitter {
11091103 this . sceneGlobalTransform ,
11101104 ) . multiply ( lt ) ;
11111105
1112- gt = Matrix3d . copy ( parent ?. globalTransform || lt , gt ) ;
1106+ Matrix3d . copy ( parent ?. globalTransform || lt , gt ) ;
11131107 }
11141108 } else {
11151109 Matrix3d . copy ( parent ?. globalTransform || gt , gt ) ;
@@ -1125,37 +1119,27 @@ export class CoreNode extends EventEmitter {
11251119 this . calculateRenderCoords ( ) ;
11261120 this . updateBoundingRect ( ) ;
11271121
1128- // this.setUpdateType(
1129- // UpdateType.RenderState |
1130- // UpdateType.Children |
1131- // UpdateType.RecalcUniforms,
1132- // );
1133-
11341122 updateType |=
11351123 UpdateType . RenderState |
11361124 UpdateType . Children |
11371125 UpdateType . RecalcUniforms ;
11381126 this . childUpdateType |= UpdateType . Global ;
11391127
11401128 if ( this . clipping === true ) {
1141- // this.setUpdateType(UpdateType.Clipping | UpdateType.RenderBounds);
11421129 updateType |= UpdateType . Clipping | UpdateType . RenderBounds ;
11431130 this . childUpdateType |= UpdateType . RenderBounds ;
11441131 }
11451132 }
11461133
1147- if ( this . updateType & UpdateType . RenderBounds ) {
1134+ if ( updateType & UpdateType . RenderBounds ) {
11481135 this . createRenderBounds ( ) ;
1149- // this.setUpdateType(UpdateType.RenderState);
1150- // this.setUpdateType(UpdateType.Children);
11511136 updateType |= UpdateType . RenderState | UpdateType . Children ;
11521137
11531138 this . childUpdateType |= UpdateType . RenderBounds ;
11541139 }
11551140
1156- if ( this . updateType & UpdateType . RenderState ) {
1141+ if ( updateType & UpdateType . RenderState ) {
11571142 renderState = this . checkRenderBounds ( ) ;
1158- // this.setUpdateType(UpdateType.IsRenderable);
11591143 updateType |= UpdateType . IsRenderable ;
11601144
11611145 // if we're not going out of bounds, update the render state
@@ -1168,11 +1152,6 @@ export class CoreNode extends EventEmitter {
11681152
11691153 if ( updateType & UpdateType . WorldAlpha ) {
11701154 this . worldAlpha = ( ( parent && parent . worldAlpha ) || 1 ) * props . alpha ;
1171- // this.setUpdateType(
1172- // UpdateType.Children |
1173- // UpdateType.PremultipliedColors |
1174- // UpdateType.IsRenderable,
1175- // );
11761155
11771156 updateType |=
11781157 UpdateType . Children |
@@ -1297,7 +1276,7 @@ export class CoreNode extends EventEmitter {
12971276
12981277 // Sorting children MUST happen after children have been updated so
12991278 // that they have the oppotunity to update their calculated zIndex.
1300- if ( this . updateType & UpdateType . ZIndexSortedChildren ) {
1279+ if ( updateType & UpdateType . ZIndexSortedChildren ) {
13011280 // reorder z-index
13021281 this . sortChildren ( ) ;
13031282 }
@@ -1321,7 +1300,6 @@ export class CoreNode extends EventEmitter {
13211300 // notify children that we are going out of bounds
13221301 // we have to do this now before we stop processing the render tree
13231302 this . notifyChildrenRTTOfUpdate ( renderState ) ;
1324- // this.childUpdateType |= UpdateType.RenderState;
13251303 }
13261304 }
13271305
0 commit comments