diff options
author | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2016-08-07 21:36:40 -0300 |
---|---|---|
committer | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2016-08-07 21:36:40 -0300 |
commit | 139b076149594e6cf508aea269b061aa8b428d9c (patch) | |
tree | 759b8371bcc2e51d9474b4cc31f1f9bfd489bc06 /Project/Bus.cpp | |
parent | 0899cd2aea1fe2e71184bd9c6a86f3bd988304e5 (diff) | |
download | PSP.git-139b076149594e6cf508aea269b061aa8b428d9c.tar.gz PSP.git-139b076149594e6cf508aea269b061aa8b428d9c.tar.xz PSP.git-139b076149594e6cf508aea269b061aa8b428d9c.zip |
Some minor fixes
Diffstat (limited to 'Project/Bus.cpp')
-rw-r--r-- | Project/Bus.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/Project/Bus.cpp b/Project/Bus.cpp index 064f481..923d947 100644 --- a/Project/Bus.cpp +++ b/Project/Bus.cpp @@ -74,10 +74,15 @@ bool Bus::Contains(wxPoint2DDouble position) const return m_rect.Contains(ptR); } +bool Bus::Intersects(wxRect2DDouble rect) const +{ + return rect.Intersects(m_rect); +} + bool Bus::PickboxContains(wxPoint2DDouble position) { - m_activePickboxID = ID_PB_NONE; - + m_activePickboxID = ID_PB_NONE; + wxPoint2DDouble ptR = RotateAtPosition(position, -m_angle); wxPoint2DDouble center(m_position.m_x + m_width / 2.0, m_position.m_y); @@ -90,12 +95,11 @@ bool Bus::PickboxContains(wxPoint2DDouble position) m_activePickboxID = ID_PB_RIGHT; return true; } - if(rectLeft.Contains(ptR)) - { + if(rectLeft.Contains(ptR)) { m_activePickboxID = ID_PB_LEFT; return true; } - + return false; } @@ -118,8 +122,8 @@ wxCursor Bus::GetBestPickboxCursor() const void Bus::MovePickbox(wxPoint2DDouble position) { - if(m_activePickboxID == ID_PB_NONE) return; - + if(m_activePickboxID == ID_PB_NONE) return; + wxPoint2DDouble ptR = RotateAtPosition(position, -m_angle); double dx = 0.0; |