Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Oct 13, 2020
1 parent 8a467c7 commit 092f39e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/netedit/GNEGeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <netedit/elements/network/GNEJunction.h>
#include <utils/gui/div/GLHelper.h>
#include <utils/gui/globjects/GLIncludes.h>
#include <utils/options/OptionsCont.h>

#include "GNEGeometry.h"
#include "GNENet.h"
Expand Down Expand Up @@ -1426,12 +1427,17 @@ GNEGeometry::drawDottedContourEdge(const DottedContourType type, const GUIVisual
GNELane::LaneDrawingConstants laneDrawingConstants(s, edge->getLanes().front());
GNEGeometry::drawDottedContourLane(type, s, edge->getLanes().front()->getDottedLaneGeometry(), laneDrawingConstants.halfWidth, drawFrontExtreme, drawBackExtreme);
} else {
// set left hand flag
const bool lefthand = OptionsCont::getOptions().getBool("lefthand");
// obtain lanes
const GNELane *topLane = lefthand? edge->getLanes().back() : edge->getLanes().front();
const GNELane *botLane = lefthand? edge->getLanes().front() : edge->getLanes().back();
// obtain a copy of both geometries
GNEGeometry::DottedGeometry dottedGeometryTop = edge->getLanes().front()->getDottedLaneGeometry();
GNEGeometry::DottedGeometry dottedGeometryBot = edge->getLanes().back()->getDottedLaneGeometry();
GNEGeometry::DottedGeometry dottedGeometryTop = topLane->getDottedLaneGeometry();
GNEGeometry::DottedGeometry dottedGeometryBot = botLane->getDottedLaneGeometry();
// obtain both LaneDrawingConstants
GNELane::LaneDrawingConstants laneDrawingConstantsFront(s, edge->getLanes().front());
GNELane::LaneDrawingConstants laneDrawingConstantsBack(s, edge->getLanes().back());
GNELane::LaneDrawingConstants laneDrawingConstantsFront(s, topLane);
GNELane::LaneDrawingConstants laneDrawingConstantsBack(s, botLane);
// move shapes to side
dottedGeometryTop.moveShapeToSide(laneDrawingConstantsFront.halfWidth);
dottedGeometryBot.moveShapeToSide(laneDrawingConstantsBack.halfWidth * -1);
Expand Down

0 comments on commit 092f39e

Please sign in to comment.