File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -739,13 +739,14 @@ impl Render for usvg::Image {
739739 ) ;
740740
741741 content. save_state( ) ;
742+ let ( x, y) = converter. point( ( rect. x( ) , rect. y( ) ) ) ;
742743 content. transform( [
743744 ( width as f64 * converter. factor_x( ) ) as f32 ,
744745 0.0 ,
745746 0.0 ,
746747 ( height as f64 * converter. factor_y( ) ) as f32 ,
747- converter. offset_x( ) as f32,
748- converter. offset_y( ) as f32,
748+ converter. offset_x( ) as f32 + x ,
749+ converter. offset_y( ) as f32 + y ,
749750 ] ) ;
750751 content. x_object( xobj_name) ;
751752 content. restore_state( ) ;
@@ -759,12 +760,7 @@ impl Render for usvg::Image {
759760 resources. x_objects( ) . pair( xobj_name, image_ref) ;
760761 resources. finish( ) ;
761762
762- xobject. bbox( Rect :: new(
763- 0.0 ,
764- 0.0 ,
765- ( rect. x( ) + rect. width( ) ) as f32 ,
766- ( rect. y( ) + rect. height( ) ) as f32 ,
767- ) ) ;
763+ xobject. bbox( ctx. c. pdf_rect( rect) ) ;
768764
769765 let scaling = 72.0 / ctx. c. dpi( ) ;
770766 let mut transform = self . transform. clone( ) ;
You can’t perform that action at this time.
0 commit comments