Prettified Code!

This commit is contained in:
ethanweber authored and GitHub Action committed 2022-08-02 21:02:28 +00:00
1 parent 73fedc7593
commit 3e0654b435
10 files changed
+53 -52

No files matched your search

+1 -1
View File
@@ -12,4 +12,4 @@ root.render(
<App />
</WebSocketProvider>
</Provider>,
);
);
@@ -132,12 +132,17 @@ export function drawCamera(camera): THREE.Object3D {
const f = camera.fx;
const displayedFocalLength = height / (2.0 * (camera.cy / f));
const width = 2.0 * (camera.cx / f) * displayedFocalLength;
const cameraWireframeObject = getCameraWireframe(1.0, displayedFocalLength, width, height);
const cameraWireframeObject = getCameraWireframe(
1.0,
displayedFocalLength,
width,
height,
);
cameraWireframeObject.translateZ(displayedFocalLength); // move the wireframe frustum back
group.add(cameraWireframeObject);
const cameraImagePlaneObject = drawCameraImagePlane(
width*2,
height*2,
width * 2,
height * 2,
camera.image,
);
group.add(cameraImagePlaneObject);
@@ -41,7 +41,7 @@ export default function WebRtcWindow() {
// connect video
pc.addEventListener('track', (evt) => {
dispatch({
type: "write",
type: 'write',
path: 'webrtcState/isConnected',
data: true,
});
@@ -55,13 +55,13 @@ export default function WebRtcWindow() {
pc.oniceconnectionstatechange = () => {
if (pc.iceConnectionState === 'connected') {
dispatch({
type: "write",
type: 'write',
path: 'webrtcState/isConnected',
data: true,
});
} else if (pc.iceConnectionState === 'disconnected') {
dispatch({
type: "write",
type: 'write',
path: 'webrtcState/isConnected',
data: false,
});
@@ -27,7 +27,6 @@ function getWebsocketEndpointFromUrl(url: string) {
}
export default function WebSocketContextFunction({ children }) {
const dispatch = useDispatch();
let socket;
+1 -1
View File
@@ -17,7 +17,7 @@ const initialState = {
output_choice: 'rgb', // the selected output
minResolution: 50,
maxResolution: 512,
field_of_view: 80
field_of_view: 80,
},
// the scene state
sceneState: {
+1 -1
View File
@@ -2,4 +2,4 @@
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import "@testing-library/jest-dom/extend-expect";
import '@testing-library/jest-dom/extend-expect';
+1 -1
View File
@@ -12,7 +12,7 @@ export function subscribe_to_changes(selector_fn, fn) {
const previous = current;
current = selector_fn(store.getState());
if (previous !== current) {
fn(previous, current);
fn(previous, current);
}
};
store.subscribe(handleChange);
+1 -1
View File
@@ -1,3 +1,3 @@
export function split_path(path_str) {
return path_str.split("/").filter((x) => x.length > 0);
return path_str.split('/').filter((x) => x.length > 0);
}