diff --git a/sources/qetgraphicsitem/commentitem.cpp b/sources/qetgraphicsitem/commentitem.cpp index 8526b0086..4c4b9baab 100644 --- a/sources/qetgraphicsitem/commentitem.cpp +++ b/sources/qetgraphicsitem/commentitem.cpp @@ -121,7 +121,7 @@ void CommentItem::updateLabel() { painter.setPen (pen); painter.setFont (QETApp::diagramTextsFont(6)); - QRectF drawing_rect(QPointF(0,0), QSizeF(100, 100)); + QRectF drawing_rect(QPointF(0,0), QSizeF(70, 100)); QRectF text_bounding; painter.drawText(drawing_rect, Qt::TextWordWrap | Qt::AlignHCenter, m_comment, &text_bounding); diff --git a/sources/qetgraphicsitem/crossrefitem.cpp b/sources/qetgraphicsitem/crossrefitem.cpp index d20fe8368..cd09306de 100644 --- a/sources/qetgraphicsitem/crossrefitem.cpp +++ b/sources/qetgraphicsitem/crossrefitem.cpp @@ -504,14 +504,15 @@ void CrossRefItem::fillCrossRef(QPainter &painter) { void CrossRefItem::AddExtraInfo(QPainter &painter) { QString comment = m_element-> elementInformations()["comment"].toString(); bool must_show = m_element-> elementInformations().keyMustShow("comment"); + if (!comment.isEmpty() && must_show) { painter.save(); painter.setFont(QETApp::diagramTextsFont(6)); QRectF r, text_bounding; qreal center = boundingRect().center().x(); - r = QRectF(QPointF(center - 50, boundingRect().bottom()), - QPointF(center + 50, boundingRect().bottom() + 50)); + r = QRectF(QPointF(center - 35, boundingRect().bottom()), + QPointF(center + 35, boundingRect().bottom() + 50)); painter.drawText(r, Qt::TextWordWrap | Qt::AlignHCenter, comment, &text_bounding); text_bounding.adjust(-1,0,1,0); //adjust only for better visual