From f954ba590fb6674edbe827f1ff651ea68ba1a3ea Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Fri, 29 Aug 2008 20:13:43 +0100 Subject: [PATCH] Fix cow vertical positioning bug --- src/bubblegen.c | 2 +- src/display_cow.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/bubblegen.c b/src/bubblegen.c index 2f54df7..7c2f855 100644 --- a/src/bubblegen.c +++ b/src/bubblegen.c @@ -38,7 +38,7 @@ // These next ones control the size and position of the "thinking circles" // (or whatever you call them) -#define BIG_KIRCLE_X 40 +#define BIG_KIRCLE_X 38 #define BIG_KIRCLE_Y 70 #define BIG_KIRCLE_DIAM 35 diff --git a/src/display_cow.c b/src/display_cow.c index 24d71b0..f0ad0e5 100644 --- a/src/display_cow.c +++ b/src/display_cow.c @@ -221,6 +221,8 @@ void display_cow(bool debug, const char *text, bool run_main, cowmode_t mode) + xcowsay.bubble_width; int total_height = max(shape_height(xcowsay.cow), xcowsay.bubble_height); + int bubble_off = max((xcowsay.bubble_height - shape_height(xcowsay.cow))/2, 0); + GdkScreen *screen = gdk_screen_get_default(); int area_w = gdk_screen_get_width(screen) - total_width; int area_h = gdk_screen_get_height(screen) - total_height; @@ -231,8 +233,8 @@ void display_cow(bool debug, const char *text, bool run_main, cowmode_t mode) area_w = 1; if (area_h < 1) area_h = 1; - - move_shape(xcowsay.cow, rand()%area_w, rand()%area_h); + + move_shape(xcowsay.cow, rand()%area_w, bubble_off + rand()%area_h); show_shape(xcowsay.cow); xcowsay.bubble = make_shape_from_pixbuf(xcowsay.bubble_pixbuf); -- 2.39.2