Clip the overlay destination rectangle to the screen area on X11

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401649
This commit is contained in:
Sam Lantinga 2006-04-17 05:38:33 +00:00
parent fccd61bcf4
commit a4f336faee
2 changed files with 47 additions and 4 deletions

View file

@ -526,6 +526,10 @@ int main(int argc, char **argv)
resized=1;
}
break;
case SDL_MOUSEBUTTONDOWN:
overlayrect.x = event.button.x - overlayrect.w/2;
overlayrect.y = event.button.y - overlayrect.h/2;
break;
case SDL_KEYDOWN:
if (event.key.keysym.sym == SDLK_SPACE)
{