Skip to content

Commit

Permalink
[MI-1594]: flip cube and visualizer orientation
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiabeluli committed Jan 27, 2025
1 parent 6d21b9d commit e1c1610
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 13 deletions.
16 changes: 8 additions & 8 deletions src/app/src/features/Visualizer/CameraDisplay/CameraDisplay.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,16 @@ class CameraDisplay extends PureComponent {
}}
/>
<button
title={i18n._('Right')}
title={i18n._('Left')}
type="button"
tabIndex={0}
className={
cameraPosition === 'Right'
? `${styles.faceRightActive}`
: `${styles.faceRight}`
cameraPosition === 'Left'
? `${styles.faceLeftActive}`
: `${styles.faceLeft}`
}
onClick={(event) => {
camera.toRightSideView();
camera.toLeftSideView();
}}
/>
<button
Expand Down Expand Up @@ -107,16 +107,16 @@ class CameraDisplay extends PureComponent {
className={styles.cornerC2}
/>
<button
title={i18n._('Left')}
title={i18n._('Right')}
type="button"
tabIndex={0}
className={
cameraPosition === 'Left'
cameraPosition === 'Right'
? `${styles.cornerC2Active}`
: `${styles.cornerC2}`
}
onClick={(event) => {
camera.toLeftSideView();
camera.toRightSideView();
}}
/>

Expand Down
16 changes: 14 additions & 2 deletions src/app/src/features/Visualizer/CameraDisplay/index.module.styl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
}

.faceTop {
transform: scale(-1, 1);
clip-path: polygon(
67% 34%,
49.5% 36.5%,
Expand All @@ -68,6 +69,7 @@
}

.faceTopActive {
transform: scale(-1, 1);
clip-path: polygon(
67% 34%,
49.5% 36.5%,
Expand All @@ -88,7 +90,8 @@
outline: none;
}

.faceRight {
.faceLeft {
transform: scale(-1, 1);
clip-path: polygon(
93.5% 80%,
74% 96%,
Expand All @@ -113,7 +116,8 @@
}
}

.faceRightActive {
.faceLeftActive {
transform: scale(-1, 1);
clip-path: polygon(
93.5% 80%,
74% 96%,
Expand All @@ -135,6 +139,7 @@
}

.faceFront {
transform: scale(-1, 1);
clip-path: polygon(
11.2% 37.2%,
0.5% 44.2%,
Expand All @@ -160,6 +165,7 @@
}

.faceFrontActive {
transform: scale(-1, 1);
clip-path: polygon(
11.2% 37.2%,
0.5% 44.2%,
Expand All @@ -181,6 +187,7 @@
}

.faceIso {
transform: scale(-1, 1);
clip-path: polygon(
69.8% 35.5%,
73% 39.5%,
Expand All @@ -204,6 +211,7 @@
}

.faceIsoActive {
transform: scale(-1, 1);
clip-path: polygon(
69.8% 35.5%,
73% 39.5%,
Expand All @@ -223,6 +231,7 @@
}

.cornerC1 {
transform: scale(-1, 1);
clip-path: polygon(63.2% 99.5%, 49% 99.5%, 60.2% 92%, 65% 91.8%, 72% 97%);
position: absolute;
background-color: white;
Expand All @@ -240,6 +249,7 @@
}

.cornerC2 {
transform: scale(-1, 1);
clip-path: polygon(1% 41.5%, 2.8% 29.5%, 9.3% 21%, 14.5% 30%, 13% 33.5%);
position: absolute;
background-color: white;
Expand All @@ -256,6 +266,7 @@
}

.cornerC2Active {
transform: scale(-1, 1);
clip-path: polygon(1% 41.5%, 2.8% 29.5%, 9.3% 21%, 14.5% 30%, 13% 33.5%);
position: absolute;
background-color: #059669;
Expand All @@ -268,6 +279,7 @@
}

.cornerC3 {
transform: scale(-1, 1);
clip-path: polygon(99% 29%, 92% 22.5%, 90% 20%, 85% 11.5%, 94% 19%);
position: absolute;
background-color: white;
Expand Down
4 changes: 2 additions & 2 deletions src/app/src/features/Visualizer/Visualizer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1346,7 +1346,7 @@ class Visualizer extends Component {
//Set default camera position to 3D
this.camera.up.set(0, 0, 1);
this.camera.position.set(
CAMERA_DISTANCE,
-CAMERA_DISTANCE,
-CAMERA_DISTANCE,
CAMERA_DISTANCE,
);
Expand Down Expand Up @@ -2268,7 +2268,7 @@ class Visualizer extends Component {

this.camera.up.set(0, 0, 1);
this.camera.position.set(
CAMERA_DISTANCE,
-CAMERA_DISTANCE,
-CAMERA_DISTANCE,
CAMERA_DISTANCE,
);
Expand Down
2 changes: 1 addition & 1 deletion src/app/src/workspace/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type Props = {

const Workspace = ({ children }: Props) => {
return (
<div className="flex flex-col h-full overflow-y-clip no-scrollbar">
<div className="flex flex-col h-full ">
<TopBar />

<div className="flex h-full no-scrollbar">
Expand Down

0 comments on commit e1c1610

Please sign in to comment.