Skip to content

Commit 3879356

Browse files
authored
Fix initial selected edges color (#566)
1 parent 4048066 commit 3879356

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/base/src/3dview/helpers.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ export function buildShape(options: {
112112
objName: string;
113113
data: IParsedShape;
114114
clippingPlanes: THREE.Plane[];
115-
selected: boolean;
116115
isSolid: boolean;
117116
isWireframe: boolean;
118117
objColor?: THREE.Color | string | number;

packages/base/src/3dview/mainview.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,6 @@ export class MainView extends React.Component<IProps, IStates> {
795795
objName,
796796
data,
797797
clippingPlanes: this._clippingPlanes,
798-
selected,
799798
isSolid,
800799
isWireframe,
801800
objColor
@@ -845,12 +844,13 @@ export class MainView extends React.Component<IProps, IStates> {
845844

846845
if (selectedNames.includes(el.name)) {
847846
this._selectedMeshes.push(el as any as BasicMesh);
848-
el.material.color = originalEdgeColor;
847+
el.material.color = BOUNDING_BOX_COLOR;
849848
el.material.linewidth = SELECTED_LINEWIDTH;
850849
el.userData.originalColor = originalEdgeColor.clone();
851850
} else {
852851
if (objColor && el.material?.color) {
853852
el.material.color = originalEdgeColor;
853+
el.material.linewidth = DEFAULT_LINEWIDTH;
854854
el.userData.originalColor = originalEdgeColor.clone();
855855
}
856856
}
@@ -1095,7 +1095,6 @@ export class MainView extends React.Component<IProps, IStates> {
10951095
return mesh;
10961096
}
10971097

1098-
private _previousSelection: { [key: string]: ISelection } | null = null;
10991098
private _updateSelected(selection: { [key: string]: ISelection }) {
11001099
const selectionChanged =
11011100
JSON.stringify(selection) !== JSON.stringify(this._previousSelection);
@@ -1702,6 +1701,8 @@ export class MainView extends React.Component<IProps, IStates> {
17021701
private _clippingPlanes = [this._clippingPlane];
17031702
private _edgeMaterials: any[] = [];
17041703

1704+
private _previousSelection: { [key: string]: ISelection } | null = null;
1705+
17051706
private _scene: THREE.Scene; // Threejs scene
17061707
private _camera: THREE.PerspectiveCamera | THREE.OrthographicCamera; // Threejs camera
17071708
private _cameraLight: THREE.PointLight;

0 commit comments

Comments
 (0)