Skip to content

Commit

Permalink
Minor improve in GUIDottedGeometry. Refs #13894
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Dec 19, 2023
1 parent 77b949f commit d549a9d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/utils/gui/div/GUIDottedGeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,14 @@ GUIDottedGeometry::GUIDottedGeometry(const GUIVisualizationSettings& s, const GU
for (int i = 1; i < (int)myUnresampledShape.size(); i++) {
myDottedGeometrySegments.push_back(Segment({myUnresampledShape[i - 1], myUnresampledShape[i]}));
}
// calculate segment length
double segmentLength = s.dottedContourSettings.segmentLength;
if (myUnresampledShape.length2D() > MAXIMUM_DOTTEDGEOMETRYLENGTH) {
segmentLength = myUnresampledShape.length2D() / (MAXIMUM_DOTTEDGEOMETRYLENGTH * 0.5);
}
// check if resample
if (d <= GUIVisualizationSettings::Detail::DottedContoursResampled) {
// calculate segment length
double segmentLength = s.dottedContourSettings.segmentLength;
if (myUnresampledShape.length2D() > MAXIMUM_DOTTEDGEOMETRYLENGTH) {
segmentLength = myUnresampledShape.length2D() / (MAXIMUM_DOTTEDGEOMETRYLENGTH * 0.5);
}
// resample all dotted geometries
for (auto& segment : myDottedGeometrySegments) {
segment.shape = segment.shape.resample(segmentLength, true);
}
Expand Down

0 comments on commit d549a9d

Please sign in to comment.