@@ -122,10 +122,9 @@ export function syncTableWidthFromTable(gantt: Gantt) {
122122function _syncTableSize ( gantt : Gantt ) {
123123 const oldTaskTableWidth : number = gantt . taskTableWidth ;
124124
125- const allColsWidth = gantt . taskListTableInstance . getAllColsWidth ( ) ;
126125 gantt . taskTableWidth =
127- ( Array . isArray ( allColsWidth ) ? allColsWidth . reduce ( ( a , b ) => a + b , 0 ) : allColsWidth ) +
128- gantt . parsedOptions . outerFrameStyle . borderLineWidth ;
126+ gantt . taskListTableInstance . getAllColsWidth ( ) + ( gantt . parsedOptions . outerFrameStyle . borderLineWidth as number ) ;
127+
129128 if ( gantt . options ?. taskListTable ?. maxTableWidth ) {
130129 gantt . taskTableWidth = Math . min ( gantt . options ?. taskListTable ?. maxTableWidth , gantt . taskTableWidth ) ;
131130 }
@@ -136,20 +135,10 @@ function _syncTableSize(gantt: Gantt) {
136135 return ;
137136 }
138137 gantt . element . style . left = gantt . taskTableWidth ? `${ gantt . taskTableWidth } px` : '0px' ;
139- const tableHeightValue =
140- typeof gantt . tableNoFrameHeight === 'number'
141- ? gantt . tableNoFrameHeight
142- : Array . isArray ( gantt . tableNoFrameHeight )
143- ? gantt . tableNoFrameHeight [ 0 ] ?? 0
144- : Number ( gantt . tableNoFrameHeight ) || 0 ;
145- const tableHeight : number = Number ( tableHeightValue ) || 0 ;
146- const borderWidth =
147- typeof gantt . parsedOptions . outerFrameStyle . borderLineWidth === 'number'
148- ? gantt . parsedOptions . outerFrameStyle . borderLineWidth
149- : Array . isArray ( gantt . parsedOptions . outerFrameStyle . borderLineWidth )
150- ? gantt . parsedOptions . outerFrameStyle . borderLineWidth [ 0 ] ?? 0
151- : 0 ;
152- gantt . taskListTableInstance . setCanvasSize ( gantt . taskTableWidth , tableHeight + borderWidth * 2 ) ;
138+ gantt . taskListTableInstance . setCanvasSize (
139+ gantt . taskTableWidth ,
140+ gantt . tableNoFrameHeight + ( gantt . parsedOptions . outerFrameStyle . borderLineWidth as number ) * 2
141+ ) ;
153142 gantt . _updateSize ( ) ;
154143 updateSplitLineAndResizeLine ( gantt ) ;
155144
0 commit comments