[librsvg] bgo#587721: Update the PangoLayout for the new matrix before rendering



commit c70000117fb6e7dabdb77c1c8cc1067add7da6d9
Author: Massimo <sixtysix inwind it>
Date:   Wed Aug 30 09:55:48 2017 -0500

    bgo#587721: Update the PangoLayout for the new matrix before rendering
    
    If the cairo_t's transformation changes between the time the
    PangoLayout is created and the time it is shown, one needs to
    pango_cairo_update_layout() first.

 rsvg-cairo-draw.c                                  |    4 ++++
 .../reftests/bugs/587721-text-transform-ref.png    |  Bin 0 -> 3910 bytes
 .../reftests/bugs/587721-text-transform.svg        |   13 +++++++++++++
 .../bugs/777834-empty-text-children-ref.png        |  Bin 9653 -> 9386 bytes
 4 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/rsvg-cairo-draw.c b/rsvg-cairo-draw.c
index ed32639..7f14448 100644
--- a/rsvg-cairo-draw.c
+++ b/rsvg-cairo-draw.c
@@ -277,6 +277,8 @@ rsvg_cairo_render_pango_layout (RsvgDrawingCtx * ctx, PangoLayout * layout, doub
                                            bbox, rsvg_current_state (ctx)->current_color)) {
             if (rotation != 0.)
                 cairo_rotate (render->cr, -rotation);
+
+            pango_cairo_update_layout (render->cr, layout);
             pango_cairo_show_layout (render->cr, layout);
         }
 
@@ -295,6 +297,8 @@ rsvg_cairo_render_pango_layout (RsvgDrawingCtx * ctx, PangoLayout * layout, doub
                                            bbox, rsvg_current_state (ctx)->current_color)) {
             if (rotation != 0.)
                 cairo_rotate (render->cr, -rotation);
+
+            pango_cairo_update_layout (render->cr, layout);
             pango_cairo_layout_path (render->cr, layout);
 
             setup_cr_for_stroke (render->cr, ctx, state);
diff --git a/tests/fixtures/reftests/bugs/587721-text-transform-ref.png 
b/tests/fixtures/reftests/bugs/587721-text-transform-ref.png
new file mode 100644
index 0000000..f9c7ec0
Binary files /dev/null and b/tests/fixtures/reftests/bugs/587721-text-transform-ref.png differ
diff --git a/tests/fixtures/reftests/bugs/587721-text-transform.svg 
b/tests/fixtures/reftests/bugs/587721-text-transform.svg
new file mode 100644
index 0000000..d86b6ef
--- /dev/null
+++ b/tests/fixtures/reftests/bugs/587721-text-transform.svg
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"  "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd";>
+<svg width="1179.75118pt" height="687.74173pt"
+     viewBox="0 0 1179.75118 687.74173"
+     enable-background="new 0 0 1179.75118 687.74173"
+     version="1.1" xmlns="http://www.w3.org/2000/svg";
+     xmlns:xlink="http://www.w3.org/1999/xlink"; >
+
+  <g font-family="'DejaVu Sans'" font-size="1" kerning="0" font-weight="400" fill="#000000">
+    <text transform="matrix(12 0 0 12 929.88438 660.96434)">Frenchtown</text>
+  </g>
+               
+</svg>
diff --git a/tests/fixtures/reftests/bugs/777834-empty-text-children-ref.png 
b/tests/fixtures/reftests/bugs/777834-empty-text-children-ref.png
index 58edc18..58a4c03 100644
Binary files a/tests/fixtures/reftests/bugs/777834-empty-text-children-ref.png and 
b/tests/fixtures/reftests/bugs/777834-empty-text-children-ref.png differ


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]