Skip to content

Commit

Permalink
Fixed flickering problem. Refs #14175
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Jan 3, 2024
1 parent fc8b3e0 commit c24e396
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/netedit/GNEViewNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,7 @@ GNEViewNet::checkSelectEdges() const {
}


bool
int
GNEViewNet::getDrawingToggle() const {
return myDrawingToggle;
}
Expand Down Expand Up @@ -3292,10 +3292,10 @@ GNEViewNet::updateCursor() {
int
GNEViewNet::drawGLElements(const Boundary& bound) {
// udpdate drawing toggle
if (myDrawingToggle) {
myDrawingToggle = false;
if (myDrawingToggle > 10000) {
myDrawingToggle = 0;
} else {
myDrawingToggle = true;
myDrawingToggle++;
}
// set default scale
myVisualizationSettings->scale = m2p(SUMO_const_laneWidth);
Expand Down
4 changes: 2 additions & 2 deletions src/netedit/GNEViewNet.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class GNEViewNet : public GUISUMOAbstractView {
std::vector<std::string> getRelDataAttrs() const;

/// @brief get draw toggle (used to avoid drawing junctions twice)
bool getDrawingToggle() const;
int getDrawingToggle() const;

/// @brief check if select edges (toggle using button or shift)
bool checkSelectEdges() const;
Expand Down Expand Up @@ -724,7 +724,7 @@ class GNEViewNet : public GUISUMOAbstractView {
bool myCreatedPopup = false;

/// @brief drawin toggle (used in drawGLElements to avoid draw elements twice)
bool myDrawingToggle = false;
int myDrawingToggle = 0;

/// @brief create edit mode buttons and elements
void buildEditModeControls();
Expand Down
2 changes: 1 addition & 1 deletion src/netedit/elements/network/GNEJunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ GNEJunction::GNEJunction(GNENet* net, NBNode* nbn, bool loaded) :
GNENetworkElement(net, nbn->getID(), GLO_JUNCTION, SUMO_TAG_JUNCTION,
GUIIconSubSys::getIcon(GUIIcon::JUNCTION), {}, {}, {}, {}, {}, {}),
myNBNode(nbn),
myDrawingToggle(new bool),
myDrawingToggle(new int),
myLogicStatus(loaded ? FEATURE_LOADED : FEATURE_GUESSED),
myHasValidLogic(loaded),
myTesselation(nbn->getID(), "", RGBColor::MAGENTA, nbn->getShape(), false, true, 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/netedit/elements/network/GNEJunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ class GNEJunction : public GNENetworkElement, public GNECandidateElement {
bool myJunctionInGrid = true;

/// @brief drawing toggle (used to avoid double draws)
bool *myDrawingToggle;
int *myDrawingToggle;

/// @brief variable used for draw circle contours
GNEContour myCircleContour;
Expand Down

0 comments on commit c24e396

Please sign in to comment.