Skip to content

Commit

Permalink
Issue LibreCAD#1773: skip hatch curves for construction layer
Browse files Browse the repository at this point in the history
  • Loading branch information
dxli committed May 9, 2024
1 parent e842d79 commit 40ba117
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions librecad/src/lib/engine/rs_entity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 40ba117

Please sign in to comment.