Example #1
0
void MapItem::updateBoundingRect()
{
    QRectF boundingRect = mapDocument()->renderer()->mapBoundingRect();

    const QMargins margins = mapDocument()->map()->computeLayerOffsetMargins();
    boundingRect.adjust(-margins.left(),
                        -margins.top(),
                        margins.right(),
                        margins.bottom());

    const QMargins drawMargins = mapDocument()->map()->drawMargins();
    boundingRect.adjust(qMin(0, -drawMargins.left()),
                        qMin(0, -drawMargins.top()),
                        qMax(0, drawMargins.right()),
                        qMax(0, drawMargins.bottom()));

    if (mBoundingRect != boundingRect) {
        prepareGeometryChange();
        mBoundingRect = boundingRect;
        emit boundingRectChanged();
    }
}
Example #2
0
void Face::setBoundingRect(const QRectF &rect)
{
    m_boundingRect = rect;
    emit boundingRectChanged();
}