Logo Search packages:      
Sourcecode: kanagram version File versions  Download package

QRect Kanagram::innerRect ( const QRect &  rect,
const int  xMargin,
const int  yMargin 
) [private]

get a rectangle inside a rectangle

Parameters:
rectouter rectangle
xMarginhow much margin to leave on the right and left side
yMarginhow much margin to leave on the top and bottom

Definition at line 531 of file kanagram.cpp.

Referenced by drawSwitcher(), drawTextNew(), and paintEvent().

{
    QRect r = rect;

    if (xMargin>0)
    {
        r.setWidth(r.width() - 2 * xMargin);
        r.translate(xMargin, 0);
    }
    if (yMargin>0)
    {
        r.setHeight(r.height() - 2 * yMargin);
        r.translate(0, yMargin);
    }

    return r;
}

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index