Skip to content

Commit

Permalink
Fixes #3408. Set the origin item to bottom so that the connectors loc…
Browse files Browse the repository at this point in the history
…ated at center of the component can be used.

Signed-off-by: adrpo <adrian.pop@liu.se>
  • Loading branch information
adeas31 authored and adrpo committed Oct 18, 2015
1 parent 7fd0367 commit 8637b07
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
22 changes: 22 additions & 0 deletions OMEdit/OMEditGUI/Component/CornerItem.cpp
Expand Up @@ -331,6 +331,28 @@ OriginItem::OriginItem()
mPen = mPassivePen;
}

/*!
* \brief OriginItem::setActive
* Sets the pen to active color.
* Sets the zValue of item to 4000 so that it shows on top of everything.
*/
void OriginItem::setActive()
{
setZValue(4000);
mPen = mActivePen;
}

/*!
* \brief OriginItem::setPassive
* Sets the pen to passive color.
* Sets the zValue of item to -4000 so that it shows on bottom of everything.
*/
void OriginItem::setPassive()
{
setZValue(-4000);
mPen = mPassivePen;
}

/*!
Reimplementation of paint.\n
Draws the cross shape for the OriginItem.
Expand Down
4 changes: 2 additions & 2 deletions OMEdit/OMEditGUI/Component/CornerItem.h
Expand Up @@ -109,8 +109,8 @@ class OriginItem : public QGraphicsItem
{
public:
OriginItem();
void setActive() {mPen = mActivePen;}
void setPassive() {mPen = mPassivePen;}
void setActive();
void setPassive();
QRectF boundingRect() const {return mRectangle;}
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
private:
Expand Down

0 comments on commit 8637b07

Please sign in to comment.