Skip to content

Commit

Permalink
Fix QGIVP boundingRect
Browse files Browse the repository at this point in the history
  • Loading branch information
WandererFan authored and wwmayer committed Aug 11, 2018
1 parent 5730aae commit 603c294
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/Mod/TechDraw/Gui/QGIView.cpp
Expand Up @@ -409,12 +409,13 @@ void QGIView::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, Q
QStyleOptionGraphicsItem myOption(*option);
myOption.state &= ~QStyle::State_Selected;

//painter->drawRect(boundingRect()); //good for debugging
// painter->drawRect(boundingRect()); //good for debugging

QGraphicsItemGroup::paint(painter, &myOption, widget);
}

QRectF QGIView::customChildrenBoundingRect() {
QRectF QGIView::customChildrenBoundingRect() const
{
QList<QGraphicsItem*> children = childItems();
int dimItemType = QGraphicsItem::UserType + 106; // TODO: Magic number warning.
int borderItemType = QGraphicsItem::UserType + 136; // TODO: Magic number warning
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/TechDraw/Gui/QGIView.h
Expand Up @@ -109,7 +109,7 @@ class TechDrawGuiExport QGIView : public QGraphicsItemGroup
// Preselection events:
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override;
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override;
virtual QRectF customChildrenBoundingRect(void);
virtual QRectF customChildrenBoundingRect(void) const;
void dumpRect(char* text, QRectF r);

QString getPrefFont(void);
Expand Down
4 changes: 3 additions & 1 deletion src/Mod/TechDraw/Gui/QGIViewPart.cpp
Expand Up @@ -984,7 +984,9 @@ void QGIViewPart::dumpPath(const char* text,QPainterPath path)

QRectF QGIViewPart::boundingRect() const
{
return childrenBoundingRect();
// return childrenBoundingRect();
// return customChildrenBoundingRect();
return QGIView::boundingRect();
}

//QGIViewPart derived classes do not need a rotate view method as rotation is handled on App side.
Expand Down

0 comments on commit 603c294

Please sign in to comment.