Skip to content

Commit

Permalink
Fix Bug with line insertion
Browse files Browse the repository at this point in the history
  • Loading branch information
beachtom committed Sep 1, 2023
1 parent fe54989 commit ddb4fef
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/wasm/parsing/IfcLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,20 +404,17 @@ namespace webifc::parsing {

void IfcLoader::UpdateLineTape(const uint32_t expressID, const uint32_t type, const uint32_t start)
{
if (_lines.size() < expressID) _lines.resize(expressID,_nullLine);
// new line?
if (_lines[expressID-1] == _nullLine)
if (expressID >= _lines.size())
{
// create line object
IfcLine * line = new IfcLine();
_lines[expressID-1]=line;
_lines.push_back(line);
// fill line data
line->ifcType = type;

line->tapeOffset = start;
_ifcTypeToExpressID[type].push_back(expressID);
}

_lines[expressID-1]->tapeOffset = start;
} else _lines[expressID-1]->tapeOffset = start;
}

void IfcLoader::AddHeaderLineTape(const uint32_t type, const uint32_t start)
Expand Down

0 comments on commit ddb4fef

Please sign in to comment.