From 742f19fb99e0c281b180bac39ff545e8af16b795 Mon Sep 17 00:00:00 2001 From: Reini Urban Date: Mon, 30 Dec 2024 16:49:30 +0100 Subject: [PATCH] spec: DIMASSOC honor the last has_lastpt_ref 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 --- src/dwg.spec | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/dwg.spec b/src/dwg.spec index 8c45763df..70050545f 100644 --- a/src/dwg.spec +++ b/src/dwg.spec @@ -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; @@ -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)