Adjusted drawings
This commit is contained in:
parent
7ee57e3be9
commit
2e704dfd9a
|
|
@ -6,7 +6,7 @@
|
|||
class GraphicsBusSectionItem : public GraphicsBaseItem
|
||||
{
|
||||
public:
|
||||
explicit GraphicsBusSectionItem(QGraphicsItem *parent = nullptr);
|
||||
explicit GraphicsBusSectionItem(const QRect &rect, QGraphicsItem *parent = nullptr);
|
||||
virtual ~GraphicsBusSectionItem();
|
||||
|
||||
void resize(int, double, double, const QPointF&) override;
|
||||
|
|
|
|||
|
|
@ -3,15 +3,15 @@
|
|||
#include <QPainter>
|
||||
#include <QStyleOption>
|
||||
|
||||
GraphicsBusSectionItem::GraphicsBusSectionItem(QGraphicsItem *parent)
|
||||
GraphicsBusSectionItem::GraphicsBusSectionItem(const QRect &rect, QGraphicsItem *parent)
|
||||
: GraphicsBaseItem(parent), m_dRatioX(1 / 10.0), m_dRatioY(1 / 10.0)
|
||||
{
|
||||
m_pen = QPen(Qt::blue, 2);
|
||||
m_brush = QBrush(QColor(100, 150, 255, 50));
|
||||
m_lastBoudingRect = QRectF(-10, -10, 20, 20);
|
||||
m_boundingRect = QRectF(-10, -10, 20, 20);
|
||||
m_dWidth = 20;
|
||||
m_dHeight = 20;
|
||||
m_lastBoudingRect = rect;
|
||||
m_boundingRect = rect;
|
||||
m_dWidth = rect.width();
|
||||
m_dHeight = rect.height();
|
||||
}
|
||||
|
||||
GraphicsBusSectionItem::~GraphicsBusSectionItem()
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ void CreatingSelector::mousePressEvent(QGraphicsSceneMouseEvent* event, Designer
|
|||
case GIT_busSection:
|
||||
{
|
||||
m_creatingMethod = CM_drag;
|
||||
m_pCreatingItem = new GraphicsBusSectionItem();
|
||||
m_pCreatingItem = new GraphicsBusSectionItem(QRect(-2, -2, 4, 4));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
Loading…
Reference in New Issue