Ticket #42: xmlroff-placeimage-cairo.diff

File xmlroff-placeimage-cairo.diff, 1.2 kB (added by lleroy, 8 months ago)

patch to fix image placement

  • a/libfo/fo-doc-cairo.c

    old new  
    10261026  static const cairo_user_data_key_t key; 
    10271027  int j; 
    10281028 
    1029   /*cairo_translate (FO_DOC_CAIRO (fo_doc)->cr, 0, height * yscale * 72.0 / PIXELS_PER_INCH);*/ 
     1029  cairo_translate (FO_DOC_CAIRO (fo_doc)->cr, 0, FO_DOC_CAIRO(fo_doc)->page_height); 
    10301030  cairo_save (FO_DOC_CAIRO(fo_doc)->cr); 
    1031   /* 
    10321031  cairo_scale (FO_DOC_CAIRO (fo_doc)->cr, 
    10331032               xscale * 72.0 / PIXELS_PER_INCH, 
    10341033               yscale * 72.0 / PIXELS_PER_INCH); 
    1035   */ 
    10361034  if (n_channels == 3) 
    10371035    { 
    10381036      format = CAIRO_FORMAT_RGB24; 
     
    11501148 
    11511149          cairo_translate (cr, 
    11521150                           x / PANGO_SCALE, 
    1153                            y / PANGO_SCALE); 
     1151                            -y / PANGO_SCALE); 
    11541152 
    11551153          g_closure_invoke (((GClosure *) libfo_pango_attr_callback_get_callback(attr)), 
    11561154                             NULL, 
     
    13501348 
    13511349  cairo_move_to (FO_DOC_CAIRO (fo_doc)->cr, 
    13521350                 x, 
    1353                  y); 
     1351                 FO_DOC_CAIRO (fo_doc)->page_height - y); 
    13541352  pango_cairo_show_layout (FO_DOC_CAIRO (fo_doc)->cr, 
    13551353                           fo_layout_get_pango_layout (fo_area_layout_get_layout (area_layout))); 
    13561354