Fix some GUI dialogs that don't fit on screen darkening on redraws

Clip_rect_setter was implemented incorrectly: it ignored the previous clip
rectangle and sometimes made the clip rectangle *larger* than it was
before. That allowed partially obscured widgets to draw to a larger screen
area than they were supposed to.

Fixes #1583, #1591, #2202.
This commit is contained in:
Jyrki Vesterinen 2017-12-12 21:42:02 +02:00
parent d2b53f5368
commit 01a81c2c6d

View file

@ -162,7 +162,9 @@ struct clip_rect_setter
{
if(operate_){
SDL_GetClipRect(surface_, &rect_);
SDL_SetClipRect(surface_, r);
SDL_Rect final_rect;
SDL_IntersectRect(&rect_, r, &final_rect);
SDL_SetClipRect(surface_, &final_rect);
}
}