File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
itext/itext.layout/itext/layout/renderer Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -442,6 +442,7 @@ internal float[] AutoLayout() {
442442 else {
443443 float totalFixed = 0 ;
444444 float totalFlexible = 0 ;
445+ float flexibleCount = 0 ;
445446 for ( int i = 0 ; i < numberOfColumns ; i ++ ) {
446447 if ( widths [ i ] . isFixed ) {
447448 widths [ i ] . finalWidth = widths [ i ] . width ;
@@ -450,13 +451,15 @@ internal float[] AutoLayout() {
450451 else {
451452 if ( ! widths [ i ] . isPercent ) {
452453 totalFlexible += widths [ i ] . width ;
454+ flexibleCount ++ ;
453455 }
454456 }
455457 }
458+ System . Diagnostics . Debug . Assert ( totalFlexible > 0 || flexibleCount > 0 ) ;
456459 extraWidth = tableWidth - totalPercent - totalFixed ;
457460 for ( int i = 0 ; i < numberOfColumns ; i ++ ) {
458461 if ( ! widths [ i ] . isPercent && ! widths [ i ] . isFixed ) {
459- widths [ i ] . finalWidth = widths [ i ] . width * extraWidth / totalFlexible ;
462+ widths [ i ] . finalWidth = totalFlexible > 0 ? widths [ i ] . width * extraWidth / totalFlexible : extraWidth / flexibleCount ;
460463 }
461464 }
462465 }
Original file line number Diff line number Diff line change 1- 36b7b2ab1debbcf4abb399de672d2ee2c03eea4d
1+ 010d71ac111f8f411aa0a603cc5b8ecd5970ae79
You can’t perform that action at this time.
0 commit comments