@@ -189,7 +189,12 @@ export class FlowCanvas<T extends BaseNodeInfo, TFlowEngine = unknown>
189189 public getRootFlowCanvas = ( ) => this . rootFlowCanvas ;
190190
191191 private canvasAttributes : Map < string , string > = new Map ( ) ;
192-
192+ private cameraModifiers ?: {
193+ xOffset : number ;
194+ yOffset : number ;
195+ widthSubtract ?: number ;
196+ heightSubtract ?: number ;
197+ } = undefined ;
193198 constructor (
194199 rootElement : HTMLElement ,
195200 disableInteraction ?: boolean ,
@@ -219,6 +224,7 @@ export class FlowCanvas<T extends BaseNodeInfo, TFlowEngine = unknown>
219224 this . rootFlowCanvas = rootFlowCanvas ;
220225 this . isNodeContainer = isNodeContainer ?? false ;
221226 this . disableInteraction = disableInteraction ?? false ;
227+ this . cameraModifiers = options ?. cameraModifiers ;
222228
223229 this . heightSpaceForHeaderFooterToolbars =
224230 heightSpaceForHeaderFooterToolbars ;
@@ -1301,8 +1307,12 @@ export class FlowCanvas<T extends BaseNodeInfo, TFlowEngine = unknown>
13011307 if ( this . hasNodeTypeSideBar ) {
13021308 offsetNodesidebar = 280 ;
13031309 }
1304- const width = maxX - minX + ( 120 + offsetNodesidebar ) / helperScale ;
1305- const height = maxY - minY + 240 / helperScaleHeight ;
1310+ const widhtModifier = this . cameraModifiers ?. widthSubtract ?? 120 ;
1311+ const heightModifier = this . cameraModifiers ?. heightSubtract ?? 240 ;
1312+
1313+ const width =
1314+ maxX - minX + ( widhtModifier + offsetNodesidebar ) / helperScale ;
1315+ const height = maxY - minY + heightModifier / helperScaleHeight ;
13061316
13071317 let scale = rootWidth / width ;
13081318 const scaleX = scale ;
@@ -1344,9 +1354,15 @@ export class FlowCanvas<T extends BaseNodeInfo, TFlowEngine = unknown>
13441354 // const boudingBoxCorrectionY =
13451355 // -boundingBox.y - (heightSpaceForHeaderFooterToolbars ?? 0); // 100; //-150 //-boundingBox.y; // -500; //boundingBox.y;
13461356
1347- const boudingBoxCorrectionX = - ( this . widthSpaceForSideToobars ?? 0 ) ; // 32; //-230; //-boundingBox.x; // 400; //;
1357+ const boudingBoxCorrectionX = - (
1358+ this . widthSpaceForSideToobars ??
1359+ this . cameraModifiers ?. xOffset ??
1360+ 0
1361+ ) ; // 32; //-230; //-boundingBox.x; // 400; //;
13481362 const boudingBoxCorrectionY = - (
1349- this . heightSpaceForHeaderFooterToolbars ?? 0
1363+ this . heightSpaceForHeaderFooterToolbars ??
1364+ this . cameraModifiers ?. yOffset ??
1365+ 0
13501366 ) ; // 100; //-150 //-boundingBox.y; // -500; //boundingBox.y;
13511367
13521368 let xOffsetNodesidebar = 0 ;
0 commit comments