Skip to content

Commit

Permalink
Updated drawing of custom shapes over junctions. Refs #14858
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Sep 9, 2024
1 parent cd16bc6 commit 13634ef
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
24 changes: 16 additions & 8 deletions src/netedit/elements/network/GNEJunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,13 +643,21 @@ GNEJunction::drawGL(const GUIVisualizationSettings& s) const {
GNEViewNetHelper::LockIcon::drawLockIcon(d, this, getType(), getPositionInView(), 1);
// draw junction name
drawJunctionName(s);
// draw dotted contour for shape
if (junctionShapeArea >= 4) {
myNetworkElementContour.drawDottedContours(s, d, this, s.dottedContourSettings.segmentWidth, true);
}
// draw dotted contour for bubble
if (drawBubble) {
myCircleContour.drawDottedContours(s, d, this, s.dottedContourSettings.segmentWidth, true);
// draw dotted contour depending if we're editing the custom shape
const GNENetworkElement* editedNetworkElement = myNet->getViewNet()->getEditNetworkElementShapes().getEditedNetworkElement();
if (editedNetworkElement && (editedNetworkElement == this)) {
// draw dotted contour geometry points
myNetworkElementContour.drawDottedContourGeometryPoints(s, d, this, myNBNode->getShape(), s.neteditSizeSettings.junctionGeometryPointRadius,
junctionExaggeration, s.dottedContourSettings.segmentWidthSmall);
} else {
// draw dotted contour for shape
if (junctionShapeArea >= 4) {
myNetworkElementContour.drawDottedContours(s, d, this, s.dottedContourSettings.segmentWidth, true);
}
// draw dotted contour for bubble
if (drawBubble) {
myCircleContour.drawDottedContours(s, d, this, s.dottedContourSettings.segmentWidth, true);
}
}
}
// calculate junction contour (always before children)
Expand Down Expand Up @@ -1823,7 +1831,7 @@ GNEJunction::calculateJunctioncontour(const GUIVisualizationSettings& s, const G
}
// check geometry points if we're editing shape
if (myShapeEdited) {
myNetworkElementContour.calculateContourAllGeometryPoints(s, d, this, myNBNode->getShape(), s.neteditSizeSettings.connectionGeometryPointRadius,
myNetworkElementContour.calculateContourAllGeometryPoints(s, d, this, myNBNode->getShape(), s.neteditSizeSettings.junctionGeometryPointRadius,
exaggeration, true);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/netedit/elements/network/GNEWalkingArea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ GNEWalkingArea::drawGL(const GUIVisualizationSettings& s) const {
(walkingAreaShape.size() > 0) && s.drawCrossingsAndWalkingareas) {
// don't draw this walking area if we're editing their junction parent
const GNENetworkElement* editedNetworkElement = myNet->getViewNet()->getEditNetworkElementShapes().getEditedNetworkElement();
if (editedNetworkElement && editedNetworkElement != myParentJunction) {
if (!editedNetworkElement || (editedNetworkElement != myParentJunction)) {
// get detail level
const auto d = s.getDetailLevel(walkingAreaExaggeration);
// draw geometry only if we'rent in drawForObjectUnderCursor mode
Expand Down

0 comments on commit 13634ef

Please sign in to comment.