From 2cd589742c6a4fd289d2f0696d844ccf18b917cb Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Fri, 6 Jan 2017 20:49:28 -0200 Subject: Several bugfixes on power elements --- Project/Transformer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Project/Transformer.cpp') diff --git a/Project/Transformer.cpp b/Project/Transformer.cpp index 7db7813..3d3156a 100644 --- a/Project/Transformer.cpp +++ b/Project/Transformer.cpp @@ -56,11 +56,11 @@ bool Transformer::AddParent(Element* parent, wxPoint2DDouble position) // Set the transformer rectangle. m_width = 70.0; m_height = 40.0; - m_rect = wxRect2DDouble(m_position.m_x - m_width / 2.0, m_position.m_y - m_height / 2.0, m_width, m_height); + SetPosition(m_position); // This method calculates the rectangle propely. // Set the "side" points. - m_pointList.push_back(wxPoint2DDouble(m_rect.GetPosition() + wxPoint2DDouble(-10, m_height / 2.0))); + m_pointList.push_back(wxPoint2DDouble(m_rect.GetPosition() + wxPoint2DDouble(-10 - m_borderSize, m_height / 2.0))); m_pointList.push_back( - wxPoint2DDouble(m_rect.GetPosition() + wxPoint2DDouble(m_width + 10, m_height / 2.0))); + wxPoint2DDouble(m_rect.GetPosition() + wxPoint2DDouble(m_width + 10 + m_borderSize, m_height / 2.0))); // Set first switch point. wxPoint2DDouble secondPoint = parentPt; -- cgit