Skip to content

Commit

Permalink
fix #10629
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Apr 29, 2022
1 parent f1b605c commit dcc9642
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
8 changes: 5 additions & 3 deletions src/guisim/GUIBaseVehicle.cpp
Expand Up @@ -489,12 +489,14 @@ GUIBaseVehicle::drawOnPos(const GUIVisualizationSettings& s, const Position& pos
case 3:
drawCarriages = drawAction_drawVehicleAsPolyWithCarriagges(s, scaledLength, true);
break;
case 4:
// do not scale circle radius by lengthGeometryFactor
GUIBaseVehicleHelper::drawAction_drawVehicleAsCircle(getVType().getWidth(), length, s.scale * upscale);
case 4: {
// do not scale circle radius by lengthGeometryFactor nor length and reduce the effect of width
const double w = 1.8 * sqrt(getVType().getWidth() / 1.8);
GUIBaseVehicleHelper::drawAction_drawVehicleAsCircle(w, s.scale * upscale);
// display text at circle center
scaledLength = 0;
break;
}
default:
break;
}
Expand Down
5 changes: 2 additions & 3 deletions src/utils/gui/div/GUIBaseVehicleHelper.cpp
Expand Up @@ -143,10 +143,9 @@ GUIBaseVehicleHelper::drawAction_drawVehicleAsTrianglePlus(const double width, c


void
GUIBaseVehicleHelper::drawAction_drawVehicleAsCircle(const double width, const double length, double detail) {
const double maxDim = MAX2(MIN2(4 * width, length), width);
GUIBaseVehicleHelper::drawAction_drawVehicleAsCircle(const double width, double detail) {
const int steps = MIN2(MAX2(16, int(detail / 5)), 64);
GLHelper::drawFilledCircle(maxDim / 5, steps);
GLHelper::drawFilledCircle(width / 2, steps);
}

void
Expand Down
2 changes: 1 addition & 1 deletion src/utils/gui/div/GUIBaseVehicleHelper.h
Expand Up @@ -50,7 +50,7 @@ class GUIBaseVehicleHelper {
static void drawAction_drawVehicleAsTrianglePlus(const double width, const double length);

/// @brief draw vehicle as a circle
static void drawAction_drawVehicleAsCircle(const double width, const double length, double detail);
static void drawAction_drawVehicleAsCircle(const double width, double detail);

/// @brief draw vehicle as a polygon
static void drawAction_drawVehicleAsPoly(const GUIVisualizationSettings& s, const SUMOVehicleShape shape, const double width, const double length,
Expand Down

0 comments on commit dcc9642

Please sign in to comment.