Skip to content

Commit

Permalink
Fixed error in drawMarkingsAndBoundings(). Refs #14327
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Mar 17, 2024
1 parent af2cfd4 commit 3a6cf54
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/netedit/elements/network/GNELane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1149,22 +1149,22 @@ GNELane::drawMarkingsAndBoundings(const GUIVisualizationSettings& s) const {
// continue depending of index
if (myIndex == 0) {
// in the first lane, draw a separator
GUIGeometry::drawGeometry(myDrawingConstants->getDetail(), myLaneGeometry,
separatorWidth, myDrawingConstants->getDrawingWidth() - separatorWidth);
GUIGeometry::drawGeometry(myDrawingConstants->getDetail(), myLaneGeometry, separatorWidth,
myDrawingConstants->getOffset() + myDrawingConstants->getDrawingWidth() - separatorWidth);
} else {
// get permissions between this and previous lane
const auto permissionsA = myParentEdge->getNBEdge()->getPermissions(myIndex - 1);
const auto permissionsB = myParentEdge->getNBEdge()->getPermissions(myIndex);
// get change left and right for passengers
const bool changeLeft = myParentEdge->getNBEdge()->allowsChangingLeft(myIndex - 1, SVC_PASSENGER);
const bool changeRight = myParentEdge->getNBEdge()->allowsChangingRight(myIndex, SVC_PASSENGER);
// if permissions are similar, draw markings. In other case, draw a separator
if (permissionsA & permissionsB) {
// if permissions are similar and we aren't drawing in spread mode, draw markings. In other case, draw a separator
if (!s.spreadSuperposed && (permissionsA & permissionsB)) {
GLHelper::drawInverseMarkings(myLaneGeometry.getShape(), myLaneGeometry.getShapeRotations(), myLaneGeometry.getShapeLengths(),
3, 6, myDrawingConstants->getDrawingWidth(), changeLeft, changeRight, s.lefthand, 1);
} else {
GUIGeometry::drawGeometry(myDrawingConstants->getDetail(), myLaneGeometry,
separatorWidth, myDrawingConstants->getDrawingWidth() + separatorWidth);
separatorWidth, myDrawingConstants->getOffset() + myDrawingConstants->getDrawingWidth() + separatorWidth);
}
// check if we have change prohibitions
if ((changeLeft && changeRight) == false) {
Expand All @@ -1183,8 +1183,8 @@ GNELane::drawMarkingsAndBoundings(const GUIVisualizationSettings& s) const {
}
// check if draw last separator
if (myIndex == (myParentEdge->getNBEdge()->getNumLanes() - 1)) {
GUIGeometry::drawGeometry(myDrawingConstants->getDetail(), myLaneGeometry,
separatorWidth, (myDrawingConstants->getDrawingWidth() * -1) + separatorWidth);
GUIGeometry::drawGeometry(myDrawingConstants->getDetail(), myLaneGeometry, separatorWidth,
myDrawingConstants->getOffset() + (myDrawingConstants->getDrawingWidth() * -1) + separatorWidth);
}
// pop matrix
GLHelper::popMatrix();
Expand Down

0 comments on commit 3a6cf54

Please sign in to comment.