Keep Googly Eyes x & y >= 0

This commit is contained in:
Bill Kendrick 2022-12-24 12:19:55 -08:00
parent 4129a8753e
commit 105b6958c5
2 changed files with 7 additions and 2 deletions

BIN
magic/icons/googlyeyes.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

@ -154,8 +154,7 @@ SDL_Surface *googlyeyes_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED)
{
char fname[1024];
// FIXME
snprintf(fname, sizeof(fname), "%simages/magic/googly-eyes-pupil.png",
snprintf(fname, sizeof(fname), "%simages/magic/googlyeyes.png",
api->data_directory);
return (IMG_Load(fname));
@ -222,6 +221,12 @@ googlyeyes_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED,
{
eye_x = x;
eye_y = y;
if (eye_x < googlyeyes_img_bkgd[which]->w / 2)
eye_x = googlyeyes_img_bkgd[which]->w / 2;
if (eye_y < googlyeyes_img_bkgd[which]->h / 2)
eye_y = googlyeyes_img_bkgd[which]->h / 2;
googlyeyes_drag(api, which, canvas, snapshot, x, y, x, y, update_rect);
}