rio: translate window when scaling results in bad window rect on screen resize
when the screen is resized, we scale the windows to match the new screen size. when the screen is too small tho, the scaled down window rect might result in a bad window rect. before, we kept the window in its original position and size making it possible to move a window out of the screen by resizing its outer rio. now, if we get a bad rectangle after scaling, we just tralslate position to the new scaled r.min point but preserve its orginal size. this keeps the window always accessible.
This commit is contained in:
parent
2fd6c5e0f6
commit
ad993a2618
1 changed files with 1 additions and 1 deletions
|
@ -643,7 +643,7 @@ resized(void)
|
|||
r.max.x = (r.max.x*n.x)/o.x;
|
||||
r.max.y = (r.max.y*n.y)/o.y;
|
||||
if(!goodrect(r))
|
||||
r = rectsubpt(w->i->r, viewr.min);
|
||||
r = rectsubpt(w->i->r, subpt(w->i->r.min, r.min));
|
||||
r = rectaddpt(r, screen->clipr.min);
|
||||
for(j=0; j<nhidden; j++)
|
||||
if(w == hidden[j])
|
||||
|
|
Loading…
Reference in a new issue