resize window to fit image (Erik Quanstrom)
This commit is contained in:
parent
dfbfbecfc6
commit
846ec3d21d
4 changed files with 13 additions and 17 deletions
|
|
@ -35,11 +35,9 @@ eresized(int new)
|
|||
}
|
||||
if(image == nil)
|
||||
return;
|
||||
r = insetrect(screen->clipr, Edge+Border);
|
||||
r.max.x = r.min.x+Dx(image->r);
|
||||
r.max.y = r.min.y+Dy(image->r);
|
||||
border(screen, r, -Border, nil, ZP);
|
||||
draw(screen, r, image, nil, image->r.min);
|
||||
r = rectaddpt(image->r, subpt(screen->r.min, image->r.min));
|
||||
if(!new)
|
||||
drawresizewindow(r);
|
||||
flushimage(display, 1);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,10 +48,10 @@ eresized(int new)
|
|||
}
|
||||
if(allims==nil || allims[which]==nil)
|
||||
return;
|
||||
r = imager();
|
||||
border(screen, r, -Border, nil, ZP);
|
||||
r.min.x += allims[which]->r.min.x - allims[0]->r.min.x;
|
||||
r.min.y += allims[which]->r.min.y - allims[0]->r.min.y;
|
||||
r = rectaddpt(allims[0]->r, subpt(screen->r.min, allims[0]->r.min));
|
||||
if(!new)
|
||||
drawresizewindow(r);
|
||||
r = rectaddpt(r, subpt(allims[which]->r.min, allims[0]->r.min));
|
||||
drawop(screen, r, allims[which], allmasks[which], allims[which]->r.min, S);
|
||||
flushimage(display, 1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,10 +37,9 @@ eresized(int new)
|
|||
}
|
||||
if(image == nil)
|
||||
return;
|
||||
r = insetrect(screen->clipr, Edge+Border);
|
||||
r.max.x = r.min.x+Dx(image->r);
|
||||
r.max.y = r.min.y+Dy(image->r);
|
||||
border(screen, r, -Border, nil, ZP);
|
||||
r = rectaddpt(image->clipr, subpt(screen->r.min, image->clipr.min));
|
||||
if(!new)
|
||||
drawresizewindow(r);
|
||||
draw(screen, r, image, nil, image->r.min);
|
||||
flushimage(display, 1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,10 +35,9 @@ eresized(int new)
|
|||
}
|
||||
if(image == nil)
|
||||
return;
|
||||
r = insetrect(screen->clipr, Edge+Border);
|
||||
r.max.x = r.min.x+Dx(image->r);
|
||||
r.max.y = r.min.y+Dy(image->r);
|
||||
border(screen, r, -Border, nil, ZP);
|
||||
r = rectaddpt(image->r, subpt(screen->r.min, image->r.min));
|
||||
if(!new)
|
||||
drawresizewindow(r);
|
||||
draw(screen, r, image, nil, image->r.min);
|
||||
flushimage(display, 1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue