@@ -691,8 +691,7 @@ protected internal virtual bool ClipBackgroundArea(DrawContext drawContext, Rect
691691 public virtual void DrawChildren ( DrawContext drawContext ) {
692692 IList < IRenderer > waitingRenderers = new List < IRenderer > ( ) ;
693693 foreach ( IRenderer child in childRenderers ) {
694- if ( FloatingHelper . IsRendererFloating ( child ) || child . GetProperty < IList < String [ ] > > ( Property . TRANSFORM ) !=
695- null ) {
694+ if ( FloatingHelper . IsRendererFloating ( child ) || child . GetProperty < Transform > ( Property . TRANSFORM ) != null ) {
696695 RootRenderer rootRenderer = GetRootRenderer ( ) ;
697696 if ( rootRenderer != null && ! rootRenderer . waitingDrawingElements . Contains ( child ) ) {
698697 rootRenderer . waitingDrawingElements . Add ( child ) ;
@@ -1510,7 +1509,7 @@ protected internal virtual Rectangle CalculateAbsolutePdfBBox() {
15101509 TransformPoints ( contentBoxPoints , rotationTransform ) ;
15111510 }
15121511 }
1513- if ( renderer . GetProperty < IList < String [ ] > > ( Property . TRANSFORM ) != null ) {
1512+ if ( renderer . GetProperty < Transform > ( Property . TRANSFORM ) != null ) {
15141513 if ( renderer is BlockRenderer || renderer is ImageRenderer || renderer is TableRenderer ) {
15151514 AffineTransform rotationTransform = renderer . CreateTransformationInsideOccupiedArea ( ) ;
15161515 TransformPoints ( contentBoxPoints , rotationTransform ) ;
@@ -1831,50 +1830,25 @@ private AffineTransform CreateTransformationInsideOccupiedArea() {
18311830 float width = backgroundArea . GetWidth ( ) ;
18321831 AffineTransform transform = AffineTransform . GetTranslateInstance ( - 1 * ( x + width / 2 ) , - 1 * ( y + height /
18331832 2 ) ) ;
1834- transform . PreConcatenate ( new AffineTransform ( this . GetTransformMatrix ( width , height ) ) ) ;
1833+ transform . PreConcatenate ( Transform . GetAffineTransform ( this . GetProperty < Transform > ( Property . TRANSFORM ) , width
1834+ , height ) ) ;
18351835 transform . PreConcatenate ( AffineTransform . GetTranslateInstance ( x + width / 2 , y + height / 2 ) ) ;
18361836 return transform ;
18371837 }
18381838
18391839 protected internal virtual void BeginTranformationIfApplied ( PdfCanvas canvas ) {
1840- if ( this . GetProperty < IList < String [ ] > > ( Property . TRANSFORM ) != null ) {
1840+ if ( this . GetProperty < Transform > ( Property . TRANSFORM ) != null ) {
18411841 AffineTransform transform = CreateTransformationInsideOccupiedArea ( ) ;
18421842 canvas . SaveState ( ) . ConcatMatrix ( transform ) ;
18431843 }
18441844 }
18451845
18461846 protected internal virtual void EndTranformationIfApplied ( PdfCanvas canvas ) {
1847- if ( this . GetProperty < IList < String [ ] > > ( Property . TRANSFORM ) != null ) {
1847+ if ( this . GetProperty < Transform > ( Property . TRANSFORM ) != null ) {
18481848 canvas . RestoreState ( ) ;
18491849 }
18501850 }
18511851
1852- private AffineTransform GetTransformMatrix ( float width , float height ) {
1853- IList < String [ ] > multipleTransform = this . GetProperty < IList < String [ ] > > ( Property . TRANSFORM ) ;
1854- AffineTransform affineTransform = new AffineTransform ( ) ;
1855- for ( int k = multipleTransform . Count - 1 ; k >= 0 ; k -- ) {
1856- String [ ] transform = multipleTransform [ k ] ;
1857- float [ ] floats = new float [ 6 ] ;
1858- for ( int i = 0 ; i < 6 ; i ++ ) {
1859- if ( i == 4 || i == 5 ) {
1860- int indexOfPercent = transform [ i ] . IndexOf ( '%' ) ;
1861- if ( indexOfPercent > 0 ) {
1862- floats [ i ] = float . Parse ( transform [ i ] . JSubstring ( 0 , indexOfPercent ) , System . Globalization . CultureInfo . InvariantCulture
1863- ) / 100 * ( i == 4 ? width : height ) ;
1864- }
1865- else {
1866- floats [ i ] = float . Parse ( transform [ i ] , System . Globalization . CultureInfo . InvariantCulture ) ;
1867- }
1868- }
1869- else {
1870- floats [ i ] = float . Parse ( transform [ i ] , System . Globalization . CultureInfo . InvariantCulture ) ;
1871- }
1872- }
1873- affineTransform . PreConcatenate ( new AffineTransform ( floats ) ) ;
1874- }
1875- return affineTransform ;
1876- }
1877-
18781852 public abstract IRenderer GetNextRenderer ( ) ;
18791853
18801854 public abstract LayoutResult Layout ( LayoutContext arg1 ) ;
0 commit comments