Skip to content

Commit

Permalink
Fix BLOCKSTRETCHACTION situation after handles
Browse files Browse the repository at this point in the history
Last fix was wrong. Each handle could have on or more indexes.

Fixes GH#1053
  • Loading branch information
michal-josef-spacek committed Dec 3, 2024
1 parent b8fd725 commit b34a644
Show file tree
Hide file tree
Showing 6 changed files with 183 additions and 111 deletions.
26 changes: 21 additions & 5 deletions doc/dynapi.texi
Original file line number Diff line number Diff line change
Expand Up @@ -8546,6 +8546,8 @@ BL, DXF 72
BL, DXF 73
@item hdls
Dwg_BLOCKSTRETCHACTION_handles*
@item bl94
BL
@item num_codes
BL, DXF 75
@item codes
Expand Down Expand Up @@ -13804,6 +13806,20 @@ BL, DXF 94
@end vtable
@end indentedblock

@strong{Dwg_BLOCKSTRETCHACTION_handle_indices} @anchor{Dwg_BLOCKSTRETCHACTION_handle_indices}
@vindex Dwg_BLOCKSTRETCHACTION_handle_indices

@indentedblock
@vtable @code

@item parent
struct _dwg_object_BLOCKSTRETCHACTION*
@item index
BL, DXF 94

@end vtable
@end indentedblock

@strong{Dwg_BLOCKSTRETCHACTION_handles} @anchor{Dwg_BLOCKSTRETCHACTION_handles}
@vindex Dwg_BLOCKSTRETCHACTION_handles

Expand All @@ -13814,10 +13830,10 @@ BL, DXF 94
struct _dwg_object_BLOCKSTRETCHACTION*
@item hdl
H, DXF 331
@item bs74
@item num_index
BS, DXF 74
@item bl94
BL, DXF 94
@item indices
Dwg_BLOCKSTRETCHACTION_handle_indices*

@end vtable
@end indentedblock
Expand Down Expand Up @@ -14559,9 +14575,9 @@ BL, DXF 97
@item fitpts
2RD*
@item start_tangent
2RD
2RD, DXF 12
@item end_tangent
2RD
2RD, DXF 13

@end vtable
@end indentedblock
Expand Down
14 changes: 10 additions & 4 deletions include/dwg.h
Original file line number Diff line number Diff line change
Expand Up @@ -7797,11 +7797,16 @@ typedef struct _dwg_object_BLOCKSCALEACTION
BLOCKACTION_WITHBASEPT_fields(5);
} Dwg_Object_BLOCKSCALEACTION;

typedef struct _dwg_BLOCKSTRETCHACTION_handle_indices {
struct _dwg_object_BLOCKSTRETCHACTION *parent;
BITCODE_BL index; // 94
} Dwg_BLOCKSTRETCHACTION_handle_indices;

typedef struct _dwg_BLOCKSTRETCHACTION_handles {
struct _dwg_object_BLOCKSTRETCHACTION *parent;
BITCODE_H hdl; // 331
BITCODE_BS bs74; // 74
BITCODE_BL bl94; // 94
BITCODE_H hdl; // 331
BITCODE_BS num_index; // 74
Dwg_BLOCKSTRETCHACTION_handle_indices *indices;
} Dwg_BLOCKSTRETCHACTION_handles;

typedef struct _dwg_BLOCKSTRETCHACTION_codes {
Expand All @@ -7819,7 +7824,8 @@ typedef struct _dwg_object_BLOCKSTRETCHACTION
BITCODE_BL num_pts; // 72
BITCODE_2RD *pts; // 10
BITCODE_BL num_hdls; // 72
Dwg_BLOCKSTRETCHACTION_handles *hdls; /*!< DXF 331, 74, 94, 94 */
Dwg_BLOCKSTRETCHACTION_handles *hdls; /*!< DXF 331, 74, 94 */
BITCODE_BL bl94;
BITCODE_BL num_codes; // 75
Dwg_BLOCKSTRETCHACTION_codes *codes; /*!< DXF 95, 76, 94 */
BLOCKACTION_doubles_fields;
Expand Down
9 changes: 7 additions & 2 deletions src/dwg.spec
Original file line number Diff line number Diff line change
Expand Up @@ -12427,8 +12427,13 @@ DWG_OBJECT (BLOCKSTRETCHACTION)
REPEAT (num_hdls, hdls, Dwg_BLOCKSTRETCHACTION_handles)
REPEAT_BLOCK
SUB_FIELD_HANDLE (hdls[rcount1], hdl, 0, 331);
SUB_FIELD_BS (hdls[rcount1], bs74, 74);
SUB_FIELD_BL (hdls[rcount1], bl94, 94);
SUB_FIELD_BS (hdls[rcount1], num_index, 74);
REPEAT2 (hdls[rcount1].num_index, hdls[rcount1].indices, Dwg_BLOCKSTRETCHACTION_handle_indices)
REPEAT_BLOCK
SUB_FIELD_BL (hdls[rcount1].indices[rcount2], index, 94);
SET_PARENT_OBJ (hdls[rcount1].indices[rcount2]);
END_REPEAT_BLOCK
END_REPEAT (hdls[rcount1].indices)
SET_PARENT_OBJ (hdls[rcount1]);
END_REPEAT_BLOCK
END_REPEAT (hdls)
Expand Down
Loading

0 comments on commit b34a644

Please sign in to comment.