diff options
Diffstat (limited to 'Project/MathOperation.cpp')
-rw-r--r-- | Project/MathOperation.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Project/MathOperation.cpp b/Project/MathOperation.cpp index c9128aa..0373c85 100644 --- a/Project/MathOperation.cpp +++ b/Project/MathOperation.cpp @@ -17,6 +17,8 @@ #include "MathOperation.h" #include "ConnectionLine.h" +#include <wx/pen.h> +#include <wx/brush.h> MathOperation::MathOperation(int id) : ControlElement(id) { @@ -54,6 +56,27 @@ void MathOperation::Draw(wxPoint2DDouble translation, double scale) const DrawNodes(); } +void MathOperation::DrawDC(wxPoint2DDouble translation, double scale, wxGraphicsContext* gc) const +{ + if (m_selected) { + gc->SetPen(*wxTRANSPARENT_PEN); + gc->SetBrush(wxBrush(m_selectionColour.GetDcRGBA())); + double borderSize = (m_borderSize * 2.0 + 1.0) / scale; + gc->DrawRectangle(m_position.m_x - m_width / 2 - borderSize / 2, m_position.m_y - m_height / 2 - borderSize / 2, m_width + borderSize, m_height + borderSize); + } + gc->SetPen(*wxBLACK_PEN); + gc->SetBrush(*wxWHITE_BRUSH); + DrawRectangle(m_position, m_width, m_height); + gc->DrawRectangle(m_position.m_x - m_width / 2, m_position.m_y - m_height / 2, m_width, m_height); + + // Draw personalized element symbol. + DrawDCSymbol(gc); + + gc->SetPen(*wxTRANSPARENT_PEN); + gc->SetBrush(*wxBLACK_BRUSH); + DrawDCNodes(gc); +} + void MathOperation::Rotate(bool clockwise) { if(clockwise) |