Skip to content

Commit

Permalink
Move all constants out of bubble generator
Browse files Browse the repository at this point in the history
  • Loading branch information
nickg committed Jun 21, 2008
1 parent 8e056a1 commit 6008c9a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/bubblegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 6008c9a

Please sign in to comment.