File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 11import { Reducer , createSelector , createSlice } from "@reduxjs/toolkit" ;
22import { v4 as uuidv4 } from "uuid" ;
3+ import { ids } from "@/constants" ;
34import type { ISTKData } from "@/types" ;
4- import booths from "./booths" ;
5- import seats from "./seats" ;
6- import shapes from "./shapes" ;
7- import text from "./text" ;
5+ import { default as booths } from "./booths" ;
6+ import { default as seats } from "./seats" ;
7+ import { default as shapes } from "./shapes" ;
8+ import { default as text } from "./text" ;
89
910export const locationPlaceholder = "Type your location here" ;
1011
@@ -248,7 +249,7 @@ export const slice = createSlice({
248249 } ,
249250 setInitialViewBoxScale : ( state , action ) => {
250251 state . initialViewBoxScale = action . payload ;
251- state . initialViewBoxScaleForWidth = document . documentElement . clientWidth ;
252+ state . initialViewBoxScaleForWidth = document . getElementById ( ids . workspace ) . clientWidth ;
252253 } ,
253254 setVisibilityOffset : ( state , action ) => {
254255 state . visibilityOffset = action . payload ;
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ export const getWorkspaceCenterY = () => {
2424
2525export const getScaleFactorAccountingForViewBoxWidth = ( scaleFactor : number , initialViewBoxScaleForWidth ?: number ) => {
2626 if ( initialViewBoxScaleForWidth ) {
27- const currentWidth = document . documentElement . clientWidth ;
27+ const currentWidth = document . getElementById ( ids . workspace ) . clientWidth ;
2828 const ratio = currentWidth / initialViewBoxScaleForWidth ;
2929 scaleFactor *= ratio >= 1 ? ratio : ratio * 1.25 ;
3030 }
You can’t perform that action at this time.
0 commit comments