mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 10:50:47 +00:00
Small patches and a missing CVS entry.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@22346 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
30d6b9f8f0
commit
584ab86e01
3 changed files with 52 additions and 14 deletions
|
@ -474,14 +474,32 @@ void NSFrameRect(const NSRect aRect)
|
|||
|
||||
void NSFrameRectWithWidth(const NSRect aRect, float frameWidth)
|
||||
{
|
||||
float width;
|
||||
NSGraphicsContext *ctxt = GSCurrentContext();
|
||||
DPScurrentlinewidth(ctxt, &width);
|
||||
DPSsetlinewidth(ctxt, frameWidth);
|
||||
DPSrectstroke(ctxt, NSMinX(aRect) + frameWidth / 2.0,
|
||||
NSMinY(aRect) + frameWidth / 2.0,
|
||||
NSWidth(aRect) - frameWidth, NSHeight(aRect) - frameWidth);
|
||||
DPSsetlinewidth(ctxt, width);
|
||||
NSRectEdge sides[] = {NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge};
|
||||
NSRect remainder = aRect;
|
||||
NSRect rects[4];
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
NSDivideRect(remainder, &rects[i], &remainder, frameWidth, sides[i]);
|
||||
}
|
||||
NSRectFillList(rects, 4);
|
||||
}
|
||||
|
||||
void
|
||||
NSFrameRectWithWidthUsingOperation(NSRect aRect, float frameWidth,
|
||||
NSCompositingOperation op)
|
||||
{
|
||||
NSRectEdge sides[] = {NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge};
|
||||
NSRect remainder = aRect;
|
||||
NSRect rects[4];
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
NSDivideRect(remainder, &rects[i], &remainder, frameWidth, sides[i]);
|
||||
}
|
||||
NSRectFillListUsingOperation(rects, 4, op);
|
||||
}
|
||||
|
||||
NSRect
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue