Skip to content

Commit

Permalink
Fixes #3408.
Browse files Browse the repository at this point in the history
Set the origin item to bottom so that the connectors located at center of the component can be used.
  • Loading branch information
adeas31 committed Aug 14, 2015
1 parent 81ecb9f commit 8e6c142
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 8e6c142

Please sign in to comment.