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)
|
if(image == nil)
|
||||||
return;
|
return;
|
||||||
r = insetrect(screen->clipr, Edge+Border);
|
r = rectaddpt(image->r, subpt(screen->r.min, image->r.min));
|
||||||
r.max.x = r.min.x+Dx(image->r);
|
if(!new)
|
||||||
r.max.y = r.min.y+Dy(image->r);
|
drawresizewindow(r);
|
||||||
border(screen, r, -Border, nil, ZP);
|
|
||||||
draw(screen, r, image, nil, image->r.min);
|
|
||||||
flushimage(display, 1);
|
flushimage(display, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,10 +48,10 @@ eresized(int new)
|
||||||
}
|
}
|
||||||
if(allims==nil || allims[which]==nil)
|
if(allims==nil || allims[which]==nil)
|
||||||
return;
|
return;
|
||||||
r = imager();
|
r = rectaddpt(allims[0]->r, subpt(screen->r.min, allims[0]->r.min));
|
||||||
border(screen, r, -Border, nil, ZP);
|
if(!new)
|
||||||
r.min.x += allims[which]->r.min.x - allims[0]->r.min.x;
|
drawresizewindow(r);
|
||||||
r.min.y += allims[which]->r.min.y - allims[0]->r.min.y;
|
r = rectaddpt(r, subpt(allims[which]->r.min, allims[0]->r.min));
|
||||||
drawop(screen, r, allims[which], allmasks[which], allims[which]->r.min, S);
|
drawop(screen, r, allims[which], allmasks[which], allims[which]->r.min, S);
|
||||||
flushimage(display, 1);
|
flushimage(display, 1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,10 +37,9 @@ eresized(int new)
|
||||||
}
|
}
|
||||||
if(image == nil)
|
if(image == nil)
|
||||||
return;
|
return;
|
||||||
r = insetrect(screen->clipr, Edge+Border);
|
r = rectaddpt(image->clipr, subpt(screen->r.min, image->clipr.min));
|
||||||
r.max.x = r.min.x+Dx(image->r);
|
if(!new)
|
||||||
r.max.y = r.min.y+Dy(image->r);
|
drawresizewindow(r);
|
||||||
border(screen, r, -Border, nil, ZP);
|
|
||||||
draw(screen, r, image, nil, image->r.min);
|
draw(screen, r, image, nil, image->r.min);
|
||||||
flushimage(display, 1);
|
flushimage(display, 1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,10 +35,9 @@ eresized(int new)
|
||||||
}
|
}
|
||||||
if(image == nil)
|
if(image == nil)
|
||||||
return;
|
return;
|
||||||
r = insetrect(screen->clipr, Edge+Border);
|
r = rectaddpt(image->r, subpt(screen->r.min, image->r.min));
|
||||||
r.max.x = r.min.x+Dx(image->r);
|
if(!new)
|
||||||
r.max.y = r.min.y+Dy(image->r);
|
drawresizewindow(r);
|
||||||
border(screen, r, -Border, nil, ZP);
|
|
||||||
draw(screen, r, image, nil, image->r.min);
|
draw(screen, r, image, nil, image->r.min);
|
||||||
flushimage(display, 1);
|
flushimage(display, 1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue