Exemple #1
0
/**
 * Height of the text (this is not equal to the bounding box height as it is
 * the height of the text at 0 angle).
 */
double RTextBasedData::getHeight() const {
    if (RMath::isNaN(height) || dirty) {
        getPainterPaths(gotDraft);
    }

    return height;
}
Exemple #2
0
/**
 * Width of the text (this is not equal to the bounding box width as it is
 * the width of the text at 0 angle).
 */
double RTextBasedData::getWidth() const {
    if (RMath::isNaN(width) || dirty) {
        getPainterPaths(gotDraft);
    }

    return width;
}
Exemple #3
0
RBox RTextData::getBoundingBox() const {
    if (!boundingBox.isValid() || dirty) {
        getPainterPaths(gotDraft);
    }

    return boundingBox;
}
Exemple #4
0
RBox RTextBasedData::getBoundingBox() const {
    if (!boundingBox.isValid() || dirty) {
        getPainterPaths(gotDraft);
    }

    //qDebug() << "bb: " << boundingBox;
    return boundingBox;
}
Exemple #5
0
void RGraphicsSceneQt::highlightEntity(REntity& entity) {
    beginPreview();
    // get painter paths for closest entity:
    QList<RPainterPath> painterPaths = getPainterPaths(entity.getId());
    for (int i = 0; i < painterPaths.size(); ++i) {
        painterPaths[i].setSelected(entity.isSelected());
        painterPaths[i].setHighlighted(true);
    }
    addToPreview(painterPaths);
    endPreview();
}
Exemple #6
0
RBox RTextBasedData::getBoundingBox(bool ignoreEmpty) const {
    if (!boundingBox.isValid() || dirty) {
        getPainterPaths(gotDraft);
    }

//    if (!ignoreEmpty && boundingBox.getWidth()<RS::PointTolerance && boundingBox.getHeight()<RS::PointTolerance) {
//        RDebug::printBacktrace();
//    }

    if (ignoreEmpty && boundingBox.getWidth()<RS::PointTolerance && boundingBox.getHeight()<RS::PointTolerance) {
        return RBox();
    }

    return boundingBox;
}