From: Jim Evins Date: Wed, 28 Aug 2002 03:22:08 +0000 (+0000) Subject: Reconciled text object alignment algorithm with view-text.c X-Git-Tag: glabels-2_3_0~811 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=40377ed17a110bfdd5315a87728eeb8813d8ec66;p=glabels Reconciled text object alignment algorithm with view-text.c git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@73 f5e0f49d-192f-0410-a22d-a8d8700d0965 --- diff --git a/glabels2/src/print.c b/glabels2/src/print.c index b94765a1..66a58dd2 100644 --- a/glabels2/src/print.c +++ b/glabels2/src/print.c @@ -507,8 +507,7 @@ draw_text_object (PrintInfo * pi, GnomeFont *font; gchar **line; gint i; - gdouble w; - gdouble x_offset, y_offset; + gdouble x_offset, y_offset, w, object_w, object_h; gdouble x, y; gdouble x0, y0; gchar *text; @@ -527,6 +526,7 @@ draw_text_object (PrintInfo * pi, gl_debug (DEBUG_PRINT, "START"); gl_label_object_get_position (GL_LABEL_OBJECT(object), &x0, &y0); + gl_label_object_get_size (object, &object_w, &object_h); lines = gl_label_text_get_lines (object); gl_label_text_get_props (object, &font_family, &font_size, &font_weight, @@ -566,10 +566,10 @@ draw_text_object (PrintInfo * pi, x_offset = 0.0; break; case GTK_JUSTIFY_CENTER: - x_offset = -w / 2.0; + x_offset = (object_w - w) / 2.0; break; case GTK_JUSTIFY_RIGHT: - x_offset = -w; + x_offset = object_w - w; break; default: x_offset = 0.0;