[gimp/gimp-2-8] Bug 726495 - "Text to path" delivers a path offset from the text

commit e7af7939a0a922c532e9e0d6c9c457d5aa768799
Author: Michael Natterer <mitch gimp org>
Date:   Fri Apr 11 16:52:42 2014 +0200

    Bug 726495 - "Text to path" delivers a path offset from the text
    In gimp_text_layout_render() do a cairo_save/restore() around drawing
    the (possibly offset and transformed) text, so we can later get the
    rendered path from cairo_copy_path() relative to the original coords
    and not relative to the offset and transformed coords.
    (cherry picked from commit 7257574b9369a60495a865341ef2a44c1186934b)

 app/text/gimptextlayout-render.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/app/text/gimptextlayout-render.c b/app/text/gimptextlayout-render.c
index c5c0a42..6fb898c 100644
--- a/app/text/gimptextlayout-render.c
+++ b/app/text/gimptextlayout-render.c
@@ -41,8 +41,9 @@ gimp_text_layout_render (GimpTextLayout    *layout,
   g_return_if_fail (GIMP_IS_TEXT_LAYOUT (layout));
   g_return_if_fail (cr != NULL);
-  gimp_text_layout_get_offsets (layout, &x, &y);
+  cairo_save (cr);
+  gimp_text_layout_get_offsets (layout, &x, &y);
   cairo_translate (cr, x, y);
   gimp_text_layout_get_transform (layout, &trafo);
@@ -54,4 +55,6 @@ gimp_text_layout_render (GimpTextLayout    *layout,
     pango_cairo_layout_path (cr, pango_layout);
     pango_cairo_show_layout (cr, pango_layout);
+  cairo_restore (cr);

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