Skip to content

Commit

Permalink
debug: fix GEOPOSITIONMARKER
Browse files Browse the repository at this point in the history
spec and test. no coverage still
  • Loading branch information
rurban committed Oct 15, 2024
1 parent cdce987 commit d5a1dce
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
2 changes: 2 additions & 0 deletions include/dwg.h
Original file line number Diff line number Diff line change
Expand Up @@ -4910,6 +4910,8 @@ typedef struct _dwg_entity_GEOPOSITIONMARKER
BITCODE_RC text_alignment; /*!< DXF 70 0 left, 1 center, 2 right */
BITCODE_B mtext_visible; /*!< DXF 290 */
BITCODE_B enable_frame_text; /*!< DXF 290 */
BITCODE_3BD ins_pt; /* DXF only, = position */
BITCODE_2RD alignment_pt; /* DXF only */
Dwg_AcDbMTextObjectEmbedded mtext;
BITCODE_B is_really_locked; /*<! DXF 70 */
BITCODE_BS annotative_data_size;/* R2018+ */
Expand Down
12 changes: 7 additions & 5 deletions src/dwg.spec
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,12 @@ DWG_ENTITY_END
FIELD_B (is_really_locked, 0); \
DXF \
{ \
FIELD_BD (alignment_pt.x, 11); \
FIELD_BD (alignment_pt.y, 21); \
FIELD_RD (alignment_pt.x, 11); \
FIELD_RD (alignment_pt.y, 21); \
VALUE_RD (0.0, 31); \
VALUE_TFF ("Embedded Object", 101); \
FIELD_BD (ins_pt.x, 10); \
FIELD_BD (ins_pt.y, 20); \
FIELD_RD (ins_pt.x, 10); \
FIELD_RD (ins_pt.y, 20); \
VALUE_RD (0.0, 30); \
SUB_FIELD_BD (mtext, rect_width, 40); \
SUB_FIELD_BD (mtext, rect_height, 41); \
Expand Down Expand Up @@ -10202,8 +10202,10 @@ DWG_ENTITY (GEOPOSITIONMARKER)
FIELD_B (mtext_visible, 290);
FIELD_RCd (text_alignment, 280);
FIELD_B (enable_frame_text, 290);
if (FIELD_VALUE (enable_frame_text))
if (FIELD_VALUE (enable_frame_text)) {
DXF { FIELD_VALUE (ins_pt) = FIELD_VALUE (position); }
CALL_SUBCLASS (_obj, GEOPOSITIONMARKER, AcDbMTextObjectEmbedded);
}
COMMON_ENTITY_HANDLE_DATA;
DWG_ENTITY_END

Expand Down
8 changes: 4 additions & 4 deletions test/unit-testing/geopositionmarker.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ api_process (dwg_object *obj)
CHK_ENTITY_TYPE (_obj, GEOPOSITIONMARKER, annotative_data_size, BS);
CHK_ENTITY_TYPE (_obj, GEOPOSITIONMARKER, is_really_locked, B);

if (attrib->mtext_type > 1)
if (_obj->enable_frame_text)
{
if (!dwg_dynapi_entity_value (attrib, "ATTRIB", "mtext", &mtext, NULL))
fail ("ATTRIB.mtext");
if (!dwg_dynapi_entity_value (_obj, "GEOPOSITIONMARKER", "mtext", &mtext, NULL))
fail ("GEOPOSITIONMARKER.mtext");
else
{
CHK_SUBCLASS_TYPE (mtext, AcDbMTextObjectEmbedded, attachment, BS);
CHK_SUBCLASS_3RD (mtext, AcDbMTextObjectEmbedded, ins_pt);
// CHK_SUBCLASS_3RD (mtext, AcDbMTextObjectEmbedded, ins_pt);
CHK_SUBCLASS_3RD (mtext, AcDbMTextObjectEmbedded, x_axis_dir);
CHK_SUBCLASS_TYPE (mtext, AcDbMTextObjectEmbedded, rect_height, BD);
CHK_SUBCLASS_TYPE (mtext, AcDbMTextObjectEmbedded, rect_width, BD);
Expand Down

0 comments on commit d5a1dce

Please sign in to comment.