@@ -428,8 +428,7 @@ public virtual void LtWidthGrow0Shrink1Item2MarginBorderPadding30Test01() {
428
428
}
429
429
430
430
[ NUnit . Framework . Test ]
431
- public virtual void LtWidthGrow0Shrink1Item2MarginBorderPadding30JustifyContentCenterAlignItemsCenterTest01
432
- ( ) {
431
+ public virtual void LtWidthGrow0Shrink1Item2MBP30JustifyContentCenterTest ( ) {
433
432
Rectangle bBox = new Rectangle ( 575 , 842 ) ;
434
433
IList < UnitValue > flexBasisValues = JavaUtil . ArraysAsList ( UnitValue . CreatePointValue ( 50f ) , UnitValue . CreatePointValue
435
434
( 50f ) , UnitValue . CreatePointValue ( 50f ) ) ;
@@ -472,57 +471,12 @@ public virtual void LtWidthGrow0Shrink1Item2MarginBorderPadding30JustifyContentC
472
471
}
473
472
474
473
[ NUnit . Framework . Test ]
475
- public virtual void LtWidthGrow0Shrink1Item2MarginBorderPadding30JustifyContentFlexEndAlignItemsFlexEndTest01
476
- ( ) {
477
- Rectangle bBox = new Rectangle ( 575 , 842 ) ;
478
- IList < UnitValue > flexBasisValues = JavaUtil . ArraysAsList ( UnitValue . CreatePointValue ( 50f ) , UnitValue . CreatePointValue
479
- ( 50f ) , UnitValue . CreatePointValue ( 50f ) ) ;
480
- Div div = new Div ( ) . SetWidth ( 200 ) . SetHeight ( 300 ) ;
481
- DocumentRenderer documentRenderer = new DocumentRenderer ( new Document ( new PdfDocument ( new PdfWriter ( new MemoryStream
482
- ( ) ) ) ) ) ;
483
- FlexContainerRenderer flexContainerRenderer = new FlexContainerRenderer ( div ) ;
484
- flexContainerRenderer . SetParent ( documentRenderer ) ;
485
- flexContainerRenderer . SetProperty ( Property . FLEX_WRAP , FlexWrapPropertyValue . WRAP ) ;
486
- flexContainerRenderer . SetProperty ( Property . JUSTIFY_CONTENT , JustifyContent . FLEX_END ) ;
487
- flexContainerRenderer . SetProperty ( Property . ALIGN_ITEMS , AlignmentPropertyValue . FLEX_END ) ;
488
- div . SetNextRenderer ( flexContainerRenderer ) ;
489
- for ( int i = 0 ; i < flexBasisValues . Count ; i ++ ) {
490
- Div flexItem = new Div ( ) . Add ( new Paragraph ( "x" ) ) ;
491
- if ( 1 == i ) {
492
- flexItem . SetMargin ( 10 ) . SetBorder ( new SolidBorder ( 15 ) ) . SetPadding ( 5 ) ;
493
- flexItem . SetHeight ( 50 ) ;
494
- }
495
- AbstractRenderer flexItemRenderer = ( AbstractRenderer ) flexItem . CreateRendererSubTree ( ) . SetParent ( documentRenderer
496
- ) ;
497
- flexItemRenderer . SetProperty ( Property . FLEX_GROW , 0f ) ;
498
- flexItemRenderer . SetProperty ( Property . FLEX_SHRINK , 1f ) ;
499
- flexItemRenderer . SetProperty ( Property . FLEX_BASIS , flexBasisValues [ i ] ) ;
500
- flexContainerRenderer . AddChild ( flexItemRenderer ) ;
501
- }
502
- IList < IList < FlexItemInfo > > rectangleTable = FlexUtil . CalculateChildrenRectangles ( bBox , ( FlexContainerRenderer
503
- ) div . GetRenderer ( ) ) ;
504
- NUnit . Framework . Assert . AreEqual ( 25.9375f , rectangleTable [ 0 ] [ 0 ] . GetRectangle ( ) . GetHeight ( ) , EPS ) ;
505
- NUnit . Framework . Assert . AreEqual ( 110.0f , rectangleTable [ 0 ] [ 1 ] . GetRectangle ( ) . GetHeight ( ) , EPS ) ;
506
- NUnit . Framework . Assert . AreEqual ( 25.9375f , rectangleTable [ 1 ] [ 0 ] . GetRectangle ( ) . GetHeight ( ) , EPS ) ;
507
- NUnit . Framework . Assert . AreEqual ( 50.0f , rectangleTable [ 0 ] [ 0 ] . GetRectangle ( ) . GetWidth ( ) , EPS ) ;
508
- NUnit . Framework . Assert . AreEqual ( 110.0f , rectangleTable [ 0 ] [ 1 ] . GetRectangle ( ) . GetWidth ( ) , EPS ) ;
509
- NUnit . Framework . Assert . AreEqual ( 50.0f , rectangleTable [ 1 ] [ 0 ] . GetRectangle ( ) . GetWidth ( ) , EPS ) ;
510
- NUnit . Framework . Assert . AreEqual ( 40.0f , rectangleTable [ 0 ] [ 0 ] . GetRectangle ( ) . GetX ( ) , EPS ) ;
511
- NUnit . Framework . Assert . AreEqual ( 0f , rectangleTable [ 0 ] [ 1 ] . GetRectangle ( ) . GetX ( ) , EPS ) ;
512
- NUnit . Framework . Assert . AreEqual ( 150.0f , rectangleTable [ 1 ] [ 0 ] . GetRectangle ( ) . GetX ( ) , EPS ) ;
513
- NUnit . Framework . Assert . AreEqual ( 166.09375f , rectangleTable [ 0 ] [ 0 ] . GetRectangle ( ) . GetY ( ) , EPS ) ;
514
- NUnit . Framework . Assert . AreEqual ( 82.03125f , rectangleTable [ 0 ] [ 1 ] . GetRectangle ( ) . GetY ( ) , EPS ) ;
515
- NUnit . Framework . Assert . AreEqual ( 82.03125f , rectangleTable [ 1 ] [ 0 ] . GetRectangle ( ) . GetY ( ) , EPS ) ;
516
- }
517
-
518
- [ NUnit . Framework . Test ]
519
- public virtual void LtWidthGrow0Shrink1Item2MarginBorderPadding30JustifyContentFlexStartAndNotValidAlignItemsFlexStartAndNotValidTest01
520
- ( ) {
474
+ public virtual void LtWidthGrow0Shrink1Item2MBP30JustifyContentFlexStartTest ( ) {
521
475
JustifyContent [ ] justifyContentValues = new JustifyContent [ ] { JustifyContent . NORMAL , JustifyContent . START
522
- , JustifyContent . END , JustifyContent . LEFT , JustifyContent . RIGHT , JustifyContent . FLEX_START } ;
476
+ , JustifyContent . STRETCH , JustifyContent . LEFT , JustifyContent . SELF_START , JustifyContent . FLEX_START } ;
523
477
AlignmentPropertyValue [ ] alignItemsValues = new AlignmentPropertyValue [ ] { AlignmentPropertyValue . START , AlignmentPropertyValue
524
- . END , AlignmentPropertyValue . SELF_START , AlignmentPropertyValue . SELF_END , AlignmentPropertyValue . BASELINE
525
- , AlignmentPropertyValue . FLEX_START } ;
478
+ . SELF_START , AlignmentPropertyValue . BASELINE , AlignmentPropertyValue . SELF_START , AlignmentPropertyValue
479
+ . FLEX_START , AlignmentPropertyValue . FLEX_START } ;
526
480
for ( int j = 0 ; j < justifyContentValues . Length ; ++ j ) {
527
481
Rectangle bBox = new Rectangle ( 575 , 842 ) ;
528
482
IList < UnitValue > flexBasisValues = JavaUtil . ArraysAsList ( UnitValue . CreatePointValue ( 50f ) , UnitValue . CreatePointValue
@@ -567,7 +521,56 @@ public virtual void LtWidthGrow0Shrink1Item2MarginBorderPadding30JustifyContentF
567
521
}
568
522
569
523
[ NUnit . Framework . Test ]
570
- public virtual void LtWidthGrow0Shrink1Item2MarginBorderPadding30AlignItemsStretchAndNormalTest01 ( ) {
524
+ public virtual void LtWidthGrow0Shrink1Item2MBP30JustifyContentFlexEndTest ( ) {
525
+ JustifyContent [ ] justifyContentValues = new JustifyContent [ ] { JustifyContent . END , JustifyContent . RIGHT , JustifyContent
526
+ . SELF_END , JustifyContent . FLEX_END } ;
527
+ AlignmentPropertyValue [ ] alignItemsValues = new AlignmentPropertyValue [ ] { AlignmentPropertyValue . END , AlignmentPropertyValue
528
+ . SELF_END , AlignmentPropertyValue . FLEX_END , AlignmentPropertyValue . FLEX_END } ;
529
+ for ( int j = 0 ; j < justifyContentValues . Length ; ++ j ) {
530
+ Rectangle bBox = new Rectangle ( 575 , 842 ) ;
531
+ IList < UnitValue > flexBasisValues = JavaUtil . ArraysAsList ( UnitValue . CreatePointValue ( 50f ) , UnitValue . CreatePointValue
532
+ ( 50f ) , UnitValue . CreatePointValue ( 50f ) ) ;
533
+ Div div = new Div ( ) . SetWidth ( 200 ) . SetHeight ( 300 ) ;
534
+ DocumentRenderer documentRenderer = new DocumentRenderer ( new Document ( new PdfDocument ( new PdfWriter ( new MemoryStream
535
+ ( ) ) ) ) ) ;
536
+ FlexContainerRenderer flexContainerRenderer = new FlexContainerRenderer ( div ) ;
537
+ flexContainerRenderer . SetParent ( documentRenderer ) ;
538
+ flexContainerRenderer . SetProperty ( Property . FLEX_WRAP , FlexWrapPropertyValue . WRAP ) ;
539
+ flexContainerRenderer . SetProperty ( Property . JUSTIFY_CONTENT , justifyContentValues [ j ] ) ;
540
+ flexContainerRenderer . SetProperty ( Property . ALIGN_ITEMS , alignItemsValues [ j ] ) ;
541
+ div . SetNextRenderer ( flexContainerRenderer ) ;
542
+ for ( int i = 0 ; i < flexBasisValues . Count ; i ++ ) {
543
+ Div flexItem = new Div ( ) . Add ( new Paragraph ( "x" ) ) ;
544
+ if ( 1 == i ) {
545
+ flexItem . SetMargin ( 10 ) . SetBorder ( new SolidBorder ( 15 ) ) . SetPadding ( 5 ) ;
546
+ flexItem . SetHeight ( 50 ) ;
547
+ }
548
+ AbstractRenderer flexItemRenderer = ( AbstractRenderer ) flexItem . CreateRendererSubTree ( ) . SetParent ( documentRenderer
549
+ ) ;
550
+ flexItemRenderer . SetProperty ( Property . FLEX_GROW , 0f ) ;
551
+ flexItemRenderer . SetProperty ( Property . FLEX_SHRINK , 1f ) ;
552
+ flexItemRenderer . SetProperty ( Property . FLEX_BASIS , flexBasisValues [ i ] ) ;
553
+ flexContainerRenderer . AddChild ( flexItemRenderer ) ;
554
+ }
555
+ IList < IList < FlexItemInfo > > rectangleTable = FlexUtil . CalculateChildrenRectangles ( bBox , ( FlexContainerRenderer
556
+ ) div . GetRenderer ( ) ) ;
557
+ NUnit . Framework . Assert . AreEqual ( 25.9375f , rectangleTable [ 0 ] [ 0 ] . GetRectangle ( ) . GetHeight ( ) , EPS ) ;
558
+ NUnit . Framework . Assert . AreEqual ( 110.0f , rectangleTable [ 0 ] [ 1 ] . GetRectangle ( ) . GetHeight ( ) , EPS ) ;
559
+ NUnit . Framework . Assert . AreEqual ( 25.9375f , rectangleTable [ 1 ] [ 0 ] . GetRectangle ( ) . GetHeight ( ) , EPS ) ;
560
+ NUnit . Framework . Assert . AreEqual ( 50.0f , rectangleTable [ 0 ] [ 0 ] . GetRectangle ( ) . GetWidth ( ) , EPS ) ;
561
+ NUnit . Framework . Assert . AreEqual ( 110.0f , rectangleTable [ 0 ] [ 1 ] . GetRectangle ( ) . GetWidth ( ) , EPS ) ;
562
+ NUnit . Framework . Assert . AreEqual ( 50.0f , rectangleTable [ 1 ] [ 0 ] . GetRectangle ( ) . GetWidth ( ) , EPS ) ;
563
+ NUnit . Framework . Assert . AreEqual ( 40.0f , rectangleTable [ 0 ] [ 0 ] . GetRectangle ( ) . GetX ( ) , EPS ) ;
564
+ NUnit . Framework . Assert . AreEqual ( 0f , rectangleTable [ 0 ] [ 1 ] . GetRectangle ( ) . GetX ( ) , EPS ) ;
565
+ NUnit . Framework . Assert . AreEqual ( 150.0f , rectangleTable [ 1 ] [ 0 ] . GetRectangle ( ) . GetX ( ) , EPS ) ;
566
+ NUnit . Framework . Assert . AreEqual ( 166.09375f , rectangleTable [ 0 ] [ 0 ] . GetRectangle ( ) . GetY ( ) , EPS ) ;
567
+ NUnit . Framework . Assert . AreEqual ( 82.03125f , rectangleTable [ 0 ] [ 1 ] . GetRectangle ( ) . GetY ( ) , EPS ) ;
568
+ NUnit . Framework . Assert . AreEqual ( 82.03125f , rectangleTable [ 1 ] [ 0 ] . GetRectangle ( ) . GetY ( ) , EPS ) ;
569
+ }
570
+ }
571
+
572
+ [ NUnit . Framework . Test ]
573
+ public virtual void LtWidthGrow0Shrink1Item2MBP30AlignItemsStretchTest ( ) {
571
574
AlignmentPropertyValue [ ] alignItemsValues = new AlignmentPropertyValue [ ] { AlignmentPropertyValue . STRETCH ,
572
575
AlignmentPropertyValue . NORMAL } ;
573
576
foreach ( AlignmentPropertyValue alignItemsValue in alignItemsValues ) {
@@ -613,8 +616,7 @@ public virtual void LtWidthGrow0Shrink1Item2MarginBorderPadding30AlignItemsStret
613
616
}
614
617
615
618
[ NUnit . Framework . Test ]
616
- public virtual void LtWidthGrow0Shrink0Item2MarginBorderPadding30JustifyContentCenterAlignItemsCenterDontFitTest01
617
- ( ) {
619
+ public virtual void LtWidthGrow0Shrink1Item2MBP30JustifyContentCenterDontFitTest ( ) {
618
620
Rectangle bBox = new Rectangle ( 575 , 842 ) ;
619
621
IList < UnitValue > flexBasisValues = JavaUtil . ArraysAsList ( UnitValue . CreatePointValue ( 100f ) , UnitValue . CreatePointValue
620
622
( 100f ) , UnitValue . CreatePointValue ( 100f ) ) ;
0 commit comments