File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
typescript/packages/subsurface-viewer/src/components Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -668,19 +668,26 @@ const Map: React.FC<MapProps> = ({
668
668
layers . push ( dummy_layer ) ;
669
669
}
670
670
671
- const m = getModelMatrixScale ( zScale ) ;
672
-
673
671
return layers . map ( ( item ) => {
674
672
if ( item ?. constructor . name === NorthArrow3DLayer . name ) {
675
673
return item ;
676
674
}
677
675
676
+ let m : Matrix4 ;
677
+ if ( ( item as Layer ) . props . modelMatrix ) {
678
+ m = ( item as Layer ) . props . modelMatrix as Matrix4 ;
679
+ m [ 10 ] *= zScale ; // Z scaling element of matrix.
680
+ } else {
681
+ m = getModelMatrixScale ( zScale ) ;
682
+ }
683
+
678
684
return ( item as Layer ) . clone ( {
679
685
// Inject "dispatchBoundingBox" function into layer for it to report back its respective bounding box.
680
686
// eslint-disable-next-line
681
687
// @ts -ignore
682
688
reportBoundingBox : dispatchBoundingBox ,
683
- // Set "modelLayer" matrix to reflect correct z scaling.
689
+
690
+ // Modify "modelMatrix" to reflect correct z scaling.
684
691
modelMatrix : m ,
685
692
} ) ;
686
693
} ) ;
You can’t perform that action at this time.
0 commit comments