[pango/misc-cleanups: 1/3] pango-view: Support transforms with --serialized




commit 992f0dceeeab8b4d5c88ffe3c3c0223a282d1048
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Dec 18 08:31:39 2021 -0500

    pango-view: Support transforms with --serialized
    
    We can just use the matrix from the deserialized
    layout.

 utils/viewer-render.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/utils/viewer-render.c b/utils/viewer-render.c
index 87b27829..8816f06f 100644
--- a/utils/viewer-render.c
+++ b/utils/viewer-render.c
@@ -373,6 +373,11 @@ do_output (PangoContext     *context,
   pango_context_set_gravity_hint (context, opt_gravity_hint);
 
   layout = make_layout (context, text, -1);
+  if (opt_serialized && supports_matrix)
+    {
+      const PangoMatrix *context_matrix = pango_context_get_matrix (pango_layout_get_context (layout));
+      matrix = context_matrix ? *context_matrix : (PangoMatrix) PANGO_MATRIX_INIT;
+    }
 
   set_transform (context, transform_cb, cb_context, cb_data, &matrix);
 


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