diff options
Diffstat (limited to 'Project/ConnectionLine.cpp')
-rw-r--r-- | Project/ConnectionLine.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Project/ConnectionLine.cpp b/Project/ConnectionLine.cpp index 4ce7df8..0c79745 100644 --- a/Project/ConnectionLine.cpp +++ b/Project/ConnectionLine.cpp @@ -16,6 +16,8 @@ */ #include "ConnectionLine.h" +#include <wx/pen.h> +#include <wx/brush.h> ConnectionLine::ConnectionLine() : ControlElement(-1) {} ConnectionLine::ConnectionLine(Node* firstNode, int id) : ControlElement(id) @@ -48,6 +50,25 @@ void ConnectionLine::Draw(wxPoint2DDouble translation, double scale) const } } +void ConnectionLine::DrawDC(wxPoint2DDouble translation, double scale, wxGraphicsContext* gc) const +{ + gc->SetBrush(*wxTRANSPARENT_BRUSH); + if (m_selected) { + gc->SetPen(wxPen(m_selectionColour.GetDcRGBA(), 1.5 + m_borderSize * 2.0)); + gc->DrawLines(m_pointList.size(), &m_pointList[0]); + } + + // Draw line (Layer 2) + gc->SetPen(wxPen(wxColour(0, 0, 0, 255), 2.0)); + gc->DrawLines(m_pointList.size(), &m_pointList[0]); + + if (m_type == ConnectionLineType::ELEMENT_LINE) { + gc->SetPen(*wxTRANSPARENT_PEN); + gc->SetBrush(wxBrush(wxColour(0, 0, 0, 255))); + DrawDCCircle(m_pointList[5], 3, 10, gc); + } +} + bool ConnectionLine::Contains(wxPoint2DDouble position) const { if(PointToLineDistance(position) < 5.0) { return true; } |