From 6008c9af046533092164daab46dce5ebc8720a2b Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Sat, 21 Jun 2008 20:12:15 +0100 Subject: [PATCH] Move all constants out of bubble generator --- src/bubblegen.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/bubblegen.c b/src/bubblegen.c index 967809e..8b06c2a 100644 --- a/src/bubblegen.c +++ b/src/bubblegen.c @@ -161,6 +161,16 @@ static GdkPixbuf *bubble_tidy(bubble_t *b) return pixbuf; } +static int bubble_content_left() +{ + return BUBBLE_BORDER + TIP_WIDTH + CORNER_RADIUS; +} + +static int bubble_content_top() +{ + return CORNER_RADIUS; +} + GdkPixbuf *make_text_bubble(char *text, int *p_width, int *p_height) { bubble_t bubble; @@ -194,8 +204,7 @@ GdkPixbuf *make_text_bubble(char *text, int *p_width, int *p_height) // Render the text gdk_draw_layout(bubble.pixmap, bubble.gc, - BUBBLE_BORDER + TIP_WIDTH + CORNER_RADIUS, - CORNER_RADIUS, layout); + bubble_content_left(), bubble_content_top(), layout); // Make sure to free the Pango objects g_object_unref(pango_context); -- 2.39.2