Skip to content

Commit c804fad

Browse files
committed
[62] Nabla Polyline skip preprocess when possible
1 parent 51567ce commit c804fad

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

62_CAD/Polyline.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ struct LineStyleInfo
199199
}
200200

201201
// If it's all draw or all gap
202-
bool isSingleSegment() const
202+
inline bool isSingleSegment() const
203203
{
204204
const bool allDraw = stipplePattern[0] == 1.0f && stipplePatternSize == 1u;
205205
const bool allGap = !isVisible();
@@ -325,6 +325,11 @@ struct LineStyleInfo
325325
inline bool hasShape() const { return shapeNormalizedPlaceInPattern != InvalidNormalizedShapeOffset; }
326326

327327
inline bool isVisible() const { return stipplePatternSize != InvalidStipplePatternSize; }
328+
329+
inline bool skipPreprocess() const
330+
{
331+
return isSingleSegment() && !hasShape() && !isRoadStyleFlag;
332+
}
328333
};
329334

330335
class CPolylineBase
@@ -491,8 +496,8 @@ class CPolyline : public CPolylineBase
491496

492497
void preprocessPolylineWithStyle(const LineStyleInfo& lineStyle, const AddShapeFunc& addShape = {})
493498
{
494-
//if (!lineStyle.isVisible())
495-
// return;
499+
if (lineStyle.skipPreprocess())
500+
return;
496501
// DISCONNECTION DETECTED, will break styling and offsetting the polyline, if you don't care about those then ignore discontinuity.
497502
// _NBL_DEBUG_BREAK_IF(!checkSectionsContinuity());
498503
PolylineConnectorBuilder connectorBuilder;

0 commit comments

Comments
 (0)