summaryrefslogtreecommitdiff
path: root/examples/viewer-pangox.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2006-02-06 13:50:10 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2006-02-06 13:50:10 +0000
commit522ce4d5b39e325471edf77cea9ad15ed98505af (patch)
tree1e7c3eba8911f6e795ba6f364caba8a1d21702a4 /examples/viewer-pangox.c
parent8c71138ba5500a3d1bf446357992e8f165101173 (diff)
downloadpango-522ce4d5b39e325471edf77cea9ad15ed98505af.tar.gz
If NULL is passed to _copy, return NULL with no warning. If NULL is passed
2006-02-06 Behdad Esfahbod <behdad@gnome.org> * pango/pango-utils.c (pango_matrix_copy, pango_matrix_free): If NULL is passed to _copy, return NULL with no warning. If NULL is passed to _free, do nothing with no warning. Docs updated. * examples/viewer-pangoxft.c (render_callback): Multiply x,y by PANGO_SCALE, as pango_xft_render_layout takes coordinates in Pango units weirdly enough. * viewer-pangocairo.c (render_callback): Do cairo_translate, to draw correct bounding boxes for x,y nonzero. * examples/renderdemo.c (do_output): If context has an all-zero matrix set, interpret it as backend does not support transformation, so warn on --rotate, and do not try to rotate. * examples/viewer-pangox.c (pangox_view_get_context): Set an all-zero matrix on context, to negotiate that we don't support transformations.
Diffstat (limited to 'examples/viewer-pangox.c')
-rw-r--r--examples/viewer-pangox.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/examples/viewer-pangox.c b/examples/viewer-pangox.c
index c4d499af..f3a88e67 100644
--- a/examples/viewer-pangox.c
+++ b/examples/viewer-pangox.c
@@ -39,8 +39,17 @@ static PangoContext *
pangox_view_get_context (gpointer instance)
{
XViewer *x = (XViewer *) instance;
+ PangoContext *context;
+ PangoMatrix matrix = {0., 0., 0., 0., 0., 0.};
- return pango_x_get_context (x->display);
+ context = pango_x_get_context (x->display);
+
+ /* We set an all-zero matrix on the context, to negotiate that
+ * this backend doesn't support transformations.
+ */
+ pango_context_set_matrix (context, &matrix);
+
+ return context;
}
typedef struct