From 40ba1172825a17a9bfe9414bed5b738cc660cf2e Mon Sep 17 00:00:00 2001 From: Dongxu Li Date: Thu, 9 May 2024 01:14:20 -0400 Subject: [PATCH] Issue #1773: skip hatch curves for construction layer --- librecad/src/lib/engine/rs_entity.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/librecad/src/lib/engine/rs_entity.cpp b/librecad/src/lib/engine/rs_entity.cpp index 8a819e1dc7..0ae7865b42 100644 --- a/librecad/src/lib/engine/rs_entity.cpp +++ b/librecad/src/lib/engine/rs_entity.cpp @@ -51,6 +51,18 @@ #include "lc_quadratic.h" +namespace { + +// Whether the entity is a member of cross hatch filling curves +bool isHatchMember(const RS_Entity* entity) { + if (entity == nullptr || entity->getParent() == nullptr) + return false; + + return entity->rtti() == RS2::EntityHatch || isHatchMember(entity->getParent()); +} + +} + /** * Default constructor. * @param parent The parent entity of this entity. @@ -1000,6 +1012,11 @@ bool RS_Entity::isConstruction(bool typeCheck) const{ // do not expand entities on construction layers, except lines return false; } + + // Issue #1773, hatch filling curves are not shown as infinite on construction layers + if (isHatchMember(this)) + return false; + if (layer) return layer->isConstruction(); return false; }