Skip to content

Commit

Permalink
Fix cow vertical positioning bug
Browse files Browse the repository at this point in the history
  • Loading branch information
nickg committed Aug 29, 2008
1 parent bd41309 commit f954ba5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/bubblegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 4 additions & 2 deletions src/display_cow.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit f954ba5

Please sign in to comment.