summaryrefslogtreecommitdiffhomepage
path: root/gui/src/renderer
diff options
context:
space:
mode:
Diffstat (limited to 'gui/src/renderer')
-rw-r--r--gui/src/renderer/components/Accordion.tsx3
-rw-r--r--gui/src/renderer/lib/3dmap.ts4
2 files changed, 4 insertions, 3 deletions
diff --git a/gui/src/renderer/components/Accordion.tsx b/gui/src/renderer/components/Accordion.tsx
index 70ae35c988..27a5be53bc 100644
--- a/gui/src/renderer/components/Accordion.tsx
+++ b/gui/src/renderer/components/Accordion.tsx
@@ -93,7 +93,8 @@ export default class Accordion extends React.Component<IProps, IState> {
private collapse() {
// First change height to height in px since it's not possible to transition to/from auto
this.setState({ containerHeight: this.getContentHeight() + 'px' }, () => {
- // Make sure new height has been applied
+ // Make sure new height has been applied. By reading offsetHeight we force the browser to
+ // apply the height before returning.
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
this.containerRef.current?.offsetHeight;
this.setState({ containerHeight: '0' });
diff --git a/gui/src/renderer/lib/3dmap.ts b/gui/src/renderer/lib/3dmap.ts
index ec4def0744..d0e130e4c8 100644
--- a/gui/src/renderer/lib/3dmap.ts
+++ b/gui/src/renderer/lib/3dmap.ts
@@ -666,8 +666,8 @@ function getProjectionMatrix(gl: WebGL2RenderingContext): mat4 {
// Create a perspective matrix, a special matrix that is
// used to simulate the distortion of perspective in a camera.
const fieldOfView = (angleOfView / 180) * Math.PI; // in radians
- // @ts-ignore
- const aspect = gl.canvas.clientWidth / gl.canvas.clientHeight;
+ const canvas = gl.canvas as HTMLCanvasElement;
+ const aspect = canvas.clientWidth / canvas.clientHeight;
const zNear = 0.1;
const zFar = 10;
const projectionMatrix = mat4.create();