diff --git a/src/netedit/GNEViewNetHelper.cpp b/src/netedit/GNEViewNetHelper.cpp index bbd00fc18c1..8904967da5e 100644 --- a/src/netedit/GNEViewNetHelper.cpp +++ b/src/netedit/GNEViewNetHelper.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include "GNEViewNetHelper.h" @@ -1623,14 +1624,23 @@ GNEViewNetHelper::SelectingArea::drawRectangleSelection(const RGBColor& color) c if (selectingUsingRectangle) { GLHelper::pushMatrix(); glTranslated(0, 0, GLO_RECTANGLESELECTION); + const double rot = myViewNet->getChanger().getRotation(); + Position selectionCorner3 = selectionCorner2; + if (rot != 0) { + glTranslated(selectionCorner1.x(), selectionCorner1.y(), 0); + glRotated(-rot, 0, 0, 1); + glTranslated(-selectionCorner1.x(), -selectionCorner1.y(), 0); + double rad = DEG2RAD(rot); + selectionCorner3 = selectionCorner3.rotateAround2D(rad, selectionCorner1); + } GLHelper::setColor(color); glLineWidth(2); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glBegin(GL_QUADS); glVertex2d(selectionCorner1.x(), selectionCorner1.y()); - glVertex2d(selectionCorner1.x(), selectionCorner2.y()); - glVertex2d(selectionCorner2.x(), selectionCorner2.y()); - glVertex2d(selectionCorner2.x(), selectionCorner1.y()); + glVertex2d(selectionCorner1.x(), selectionCorner3.y()); + glVertex2d(selectionCorner3.x(), selectionCorner3.y()); + glVertex2d(selectionCorner3.x(), selectionCorner1.y()); glEnd(); GLHelper::popMatrix(); }