From 026677c66e95b2e7a0714292083035b93cf4b942 Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Wed, 3 Oct 2007 18:55:58 +0300 Subject: [PATCH] Rotate correctly --- src/gtkcompass.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gtkcompass.c b/src/gtkcompass.c index e570140..2e143f5 100644 --- a/src/gtkcompass.c +++ b/src/gtkcompass.c @@ -390,12 +390,11 @@ for (i = 0; i < 5; i++) { > abs((guint) (compass->data->heading / 45) * 45 + 45 - compass->data->heading) && (i > 0)) x = fsize[i - 1]; - pango_matrix_rotate (&matrix, dir); - pango_context_set_matrix (compass->context, &matrix); - pango_font_description_set_size(compass->fontdesc, (10 + x + fs) * PANGO_SCALE); pango_layout_set_font_description(compass->layout, compass->fontdesc); pango_layout_set_text(compass->layout, text, -1); + pango_matrix_rotate (&matrix, -(dir-compass->data->heading)); + pango_context_set_matrix (compass->context, &matrix); pango_layout_get_pixel_size(compass->layout, &x, &y); x = compass->xoffset + size / 2 + ((size / 2 + 15) * sinf(tmp)) - x / 2, y = compass->yoffset + size - ((size / 2 + 15) * cosf(tmp)) - y / 2, -- 2.39.5