Skip to content

Commit

Permalink
fix: allow initializing scaling factor value
Browse files Browse the repository at this point in the history
  • Loading branch information
hkfb committed Sep 17, 2024
1 parent cca0942 commit 3df20bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions typescript/packages/subsurface-viewer/src/utils/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ function convertToArrowEvent(event: KeyboardEvent): ArrowEvent | null {
* the state, and a ref that is used to attach the event listener used for
* keyboard events.
*/
export const useScaleFactor = () => {
const [factor, setFactor] = React.useState(1);
export const useScaleFactor = (initialValue?: number) => {
const [factor, setFactor] = React.useState(initialValue ?? 1);

const elementRef = React.useRef<HTMLElement>(null);

Expand Down

0 comments on commit 3df20bb

Please sign in to comment.