@@ -446,9 +446,9 @@ fn prep_pattern(
446446 let matrix = transform_to_matrix ( pattern. transform ) ;
447447 let pdf_rect = ctx. c . pdf_rect ( rect) ;
448448
449- let mut inner_matrix = if let Some ( viewbox) = pattern. view_box {
449+ let mut inner_transform = if let Some ( viewbox) = pattern. view_box {
450450 CoordToPdf :: new ( ( rect. width ( ) , rect. height ( ) ) , ctx. c . dpi ( ) , viewbox, None )
451- . uncorrected_matrix ( )
451+ . uncorrected_transformation ( )
452452 } else if pattern. content_units == Units :: ObjectBoundingBox {
453453 let viewbox = ViewBox {
454454 rect : usvg:: Rect :: new ( 0.0 , 0.0 , 1.0 , 1.0 ) . unwrap ( ) ,
@@ -460,20 +460,20 @@ fn prep_pattern(
460460 } ;
461461
462462 CoordToPdf :: new ( ( bbox. width ( ) , bbox. height ( ) ) , ctx. c . dpi ( ) , viewbox, None )
463- . uncorrected_matrix ( )
463+ . uncorrected_transformation ( )
464464 } else {
465- [ 1.0 , 0.0 , 0.0 , 1.0 , 0.0 , 0.0 ]
465+ Transform :: new ( 1.0 , 0.0 , 0.0 , 1.0 , 0.0 , 0.0 )
466466 } ;
467467
468468 ctx. push ( ) ;
469469
470- inner_matrix [ 4 ] += rect. x ( ) ;
471- inner_matrix [ 5 ] += rect. y ( ) ;
470+ inner_transform . e += rect. x ( ) ;
471+ inner_transform . f += rect. y ( ) ;
472472
473- let old = ctx. c . transform ( inner_matrix ) ;
473+ let old = ctx. c . concat_transform ( inner_transform ) ;
474474
475475 let pattern_stream = content_stream ( node, writer, ctx) ;
476- ctx. c . transform ( old) ;
476+ ctx. c . set_transform ( old) ;
477477
478478 let pattern_ref = ctx. alloc_ref ( ) ;
479479 let mut pdf_pattern = writer. tiling_pattern ( pattern_ref, & pattern_stream) ;
@@ -509,22 +509,16 @@ impl Render for usvg::Group {
509509 ctx. push ( ) ;
510510
511511 let group_ref = ctx. alloc_ref ( ) ;
512- let child_content = content_stream ( & node, writer, ctx) ;
513512
514513 let bbox = node
515514 . calculate_bbox ( )
516515 . and_then ( |b| b. to_rect ( ) )
517516 . unwrap_or_else ( || usvg:: Rect :: new ( 0.0 , 0.0 , 1.0 , 1.0 ) . unwrap ( ) ) ;
518517
519518 let pdf_bbox = ctx. c . pdf_rect ( bbox) ;
520- let old = ctx. c . transform ( [
521- self . transform . a ,
522- self . transform . b ,
523- self . transform . c ,
524- self . transform . d ,
525- self . transform . e ,
526- self . transform . f ,
527- ] ) ;
519+ let old = ctx. c . concat_transform ( self . transform ) ;
520+
521+ let child_content = content_stream ( & node, writer, ctx) ;
528522
529523 // Every group is an isolated transparency group, it needs to be painted
530524 // onto its own canvas.
@@ -545,7 +539,7 @@ impl Render for usvg::Group {
545539 content. save_state ( ) ;
546540
547541 apply_clip_path ( self . clip_path . as_ref ( ) , content, ctx) ;
548- ctx. c . transform ( old) ;
542+ ctx. c . set_transform ( old) ;
549543
550544 if let Some ( reference) = apply_mask ( self . mask . as_ref ( ) , bbox, pdf_bbox, ctx) {
551545 let num = ctx. alloc_gs ( ) ;
0 commit comments