Skip to content

Commit

Permalink
Updated GNEJunction. Refs #13894
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Dec 19, 2023
1 parent 7af18ae commit b7cdf43
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
18 changes: 9 additions & 9 deletions src/netedit/elements/network/GNEJunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,19 +616,19 @@ GNEJunction::updateCenteringBoundary(const bool updateGrid) {

void
GNEJunction::drawGL(const GUIVisualizationSettings& s) const {
// draw boundaries
if (myJunctionInGrid) {
GLHelper::drawBoundary(s, getCenteringBoundary());
}
// get junction exaggeration
const double junctionExaggeration = getExaggeration(s);
// get detail level
const auto d = s.getDetailLevel(junctionExaggeration);
// check if draw junction as shape
const bool junctionShape = ((myNBNode->getShape().size() > 0) && s.drawJunctionShape);
const bool junctionBubble = drawAsBubble(s);
// only continue if exaggeration is greater than 0
if (junctionExaggeration > 0) {
// draw boundaries
if (myJunctionInGrid) {
GLHelper::drawBoundary(s, getCenteringBoundary());
}
// get detail level
const auto d = s.getDetailLevel(junctionExaggeration);
// check if draw junction as shape
const bool junctionShape = ((myNBNode->getShape().size() > 0) && s.drawJunctionShape);
const bool junctionBubble = drawAsBubble(s);
// draw geometry only if we'rent in drawForObjectUnderCursor mode
if (!s.drawForObjectUnderCursor) {
// get mouse position
Expand Down
10 changes: 6 additions & 4 deletions src/utils/gui/div/GLHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,15 @@ GLHelper::drawFilledPolyTesselated(const PositionVector& v, bool close) {

void
GLHelper::drawRectangle(const Position& center, const double width, const double height) {
const double halfWidth = width * 0.5;
const double halfHeight = height * 0.5;
GLHelper::pushMatrix();
glTranslated(center.x(), center.y(), 0);
glBegin(GL_QUADS);
glVertex2d(-width, height);
glVertex2d(-width, -height);
glVertex2d(width, -height);
glVertex2d(width , height);
glVertex2d(-halfWidth, halfHeight);
glVertex2d(-halfWidth, -halfHeight);
glVertex2d(halfWidth, -halfHeight);
glVertex2d(halfWidth , halfHeight);
glEnd();
GLHelper::popMatrix();
#ifdef CHECK_ELEMENTCOUNTER
Expand Down

0 comments on commit b7cdf43

Please sign in to comment.