From: Kaj-Michael Lang Date: Wed, 3 Oct 2007 15:55:58 +0000 (+0300) Subject: Rotate correctly X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=026677c66e95b2e7a0714292083035b93cf4b942;p=mapper Rotate correctly --- 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,