diff options
author | Thales1330 <thaleslima.ufu@gmail.com> | 2016-08-18 19:10:04 -0300 |
---|---|---|
committer | Thales1330 <thaleslima.ufu@gmail.com> | 2016-08-18 19:10:04 -0300 |
commit | 05525745c0b0d189484da3c45f95356d7558e2cf (patch) | |
tree | e05100d4711e4050985e3d550bf9053a3c22942f /Project/Element.cpp | |
parent | e58cec073cbd982246898c733ae21b9f2b92b2b7 (diff) | |
download | PSP.git-05525745c0b0d189484da3c45f95356d7558e2cf.tar.gz PSP.git-05525745c0b0d189484da3c45f95356d7558e2cf.tar.xz PSP.git-05525745c0b0d189484da3c45f95356d7558e2cf.zip |
Line improvements, context menu implemented
Line still under construction, contex menu base implemented
Diffstat (limited to 'Project/Element.cpp')
-rw-r--r-- | Project/Element.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/Project/Element.cpp b/Project/Element.cpp index 55cb87d..7f0e211 100644 --- a/Project/Element.cpp +++ b/Project/Element.cpp @@ -10,12 +10,6 @@ void Element::SetPosition(const wxPoint2DDouble position) m_width + 2.0 * m_borderSize, m_height + 2.0 * m_borderSize); } -wxPoint2DDouble Element::WorldToScreen(wxPoint2DDouble translation, double scale, double offsetX, double offsetY) const -{ - return wxPoint2DDouble(m_position.m_x + offsetX + translation.m_x, m_position.m_y + offsetY + translation.m_y) * - scale; -} - void Element::DrawCircle(wxPoint2DDouble position, double radius, int numSegments, GLenum mode) const { glBegin(mode); @@ -102,3 +96,15 @@ wxPoint2DDouble Element::GetSwitchPoint(Element* parent, wxPoint2DDouble parentP std::sin(wxDegToRad(angle)) * (swPoint.m_x - parentPoint.m_x) + std::cos(wxDegToRad(angle)) * (swPoint.m_y - parentPoint.m_y) + parentPoint.m_y); } + +wxPoint2DDouble Element::WorldToScreen(wxPoint2DDouble translation, double scale, double offsetX, double offsetY) const +{ + return wxPoint2DDouble(m_position.m_x + offsetX + translation.m_x, m_position.m_y + offsetY + translation.m_y) * + scale; +} + +wxPoint2DDouble Element::WorldToScreen(wxPoint2DDouble position, wxPoint2DDouble translation, double scale, double offsetX, double offsetY) const +{ + return wxPoint2DDouble(position.m_x + offsetX + translation.m_x, position.m_y + offsetY + translation.m_y) * + scale; +} |