Skip to content

Commit

Permalink
spec: DIMASSOC honor the last has_lastpt_ref
Browse files Browse the repository at this point in the history
There is only one error case missing, where there's an additional point.
But all other last has_lastpt_ref: 0 cases end there.

GH #1031
  • Loading branch information
rurban committed Dec 30, 2024
1 parent b60a6c1 commit 742f19f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/dwg.spec
Original file line number Diff line number Diff line change
Expand Up @@ -9935,21 +9935,21 @@ DWG_ENTITY_END
FIELD_B (dimension.flip_arrow1, 297)

// (varies) UNSTABLE
// 1-4 references, see associativity bits 1-8.
// 1-6 references, see associativity bits 1-8.
DWG_OBJECT (DIMASSOC)

int one_more = 0;
HANDLE_UNKNOWN_BITS;
SUBCLASS (AcDbDimAssoc)
FIELD_BLx (associativity, 90);
FIELD_B (trans_space_flag, 70);
FIELD_RC (rotated_type, 71);
FIELD_HANDLE (dimensionobj, 4, 330);
// 6 = maximum of items
REPEAT_CN (6, ref, Dwg_DIMASSOC_Ref) // i.e. AcDbOsnapPointRef
REPEAT_BLOCK
// there could be more blocks, up to 5.
// there could be more blocks, up to 5 or 6.
// 0 1 2 3 => 1 2 4 8. skip unset bits
if (!(FIELD_VALUE (associativity) & (1 << rcount1)))
if (!(FIELD_VALUE (associativity) & (1 << rcount1)) && !one_more)
{
#ifdef IS_JSON
ENDHASH;
Expand Down Expand Up @@ -9986,6 +9986,7 @@ DWG_OBJECT (DIMASSOC)
FIELD_VECTOR_T (ref[rcount1].intersec_xrefpaths, T, ref[rcount1].num_intersec_xrefpaths, 302)
}
SUB_FIELD_B (ref[rcount1], has_lastpt_ref, 75);
one_more = SUB_FIELD_VALUE(ref[rcount1], has_lastpt_ref);
SET_PARENT_OBJ (ref[rcount1]);
END_REPEAT_BLOCK
END_REPEAT (ref)
Expand Down

0 comments on commit 742f19f

Please sign in to comment.