[gtk+] themingeninge: Handle translations properly
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] themingeninge: Handle translations properly
- Date: Sun, 22 May 2011 04:14:42 +0000 (UTC)
commit ec34c4bd83fab5a0b043f49182a6644e5d5f4647
Author: Benjamin Otte <otte redhat com>
Date: Sun May 22 03:53:21 2011 +0200
themingeninge: Handle translations properly
We want to keep the location of where to render, but transform th
context by the pango transform.
gtk/gtkthemingengine.c | 17 +++--------------
1 files changed, 3 insertions(+), 14 deletions(-)
---
diff --git a/gtk/gtkthemingengine.c b/gtk/gtkthemingengine.c
index 19b6dfc..4ae5904 100644
--- a/gtk/gtkthemingengine.c
+++ b/gtk/gtkthemingengine.c
@@ -2370,29 +2370,18 @@ prepare_context_for_layout (cairo_t *cr,
matrix = pango_context_get_matrix (pango_layout_get_context (layout));
+ cairo_move_to (cr, x, y);
+
if (matrix)
{
cairo_matrix_t cairo_matrix;
- PangoRectangle rect;
cairo_matrix_init (&cairo_matrix,
matrix->xx, matrix->yx,
matrix->xy, matrix->yy,
matrix->x0, matrix->y0);
- pango_layout_get_extents (layout, NULL, &rect);
- pango_matrix_transform_rectangle (matrix, &rect);
- pango_extents_to_pixels (&rect, NULL);
-
- cairo_matrix.x0 += x - rect.x;
- cairo_matrix.y0 += y - rect.y;
-
- cairo_set_matrix (cr, &cairo_matrix);
- cairo_move_to (cr, 0, 0);
- }
- else
- {
- cairo_move_to (cr, x, y);
+ cairo_transform (cr, &cairo_matrix);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]