@mlightcad/libredwg-web 0.4.4 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/libredwg-web.js +11 -2
- package/dist/libredwg-web.umd.cjs +11 -2
- package/lib/converter/converter.js +11 -5
- package/package.json +1 -1
package/dist/libredwg-web.js
CHANGED
|
@@ -7251,7 +7251,8 @@ class LibreDwgConverter {
|
|
|
7251
7251
|
const description = libredwg.dwg_dynapi_entity_value(item, "description").data;
|
|
7252
7252
|
const numDashes = libredwg.dwg_dynapi_entity_value(item, "numdashes").data;
|
|
7253
7253
|
const patternLen = libredwg.dwg_dynapi_entity_value(item, "pattern_len").data;
|
|
7254
|
-
const
|
|
7254
|
+
const dashes = libredwg.dwg_dynapi_entity_value(item, "dashes").data;
|
|
7255
|
+
const dashArray = dashes ? libredwg.dwg_ptr_to_ltype_dash_array(dashes, numDashes) : [];
|
|
7255
7256
|
return {
|
|
7256
7257
|
...commonAttrs,
|
|
7257
7258
|
description,
|
|
@@ -7266,7 +7267,15 @@ class LibreDwgConverter {
|
|
|
7266
7267
|
dashes.forEach((dash) => {
|
|
7267
7268
|
patterns.push({
|
|
7268
7269
|
elementLength: dash.length || 0,
|
|
7269
|
-
elementTypeFlag:
|
|
7270
|
+
elementTypeFlag: dash.complex_shapecode,
|
|
7271
|
+
shapeNumber: dash.shape_flag,
|
|
7272
|
+
// TODO: convert style handle to style object id
|
|
7273
|
+
// styleObjectId: dash.style,
|
|
7274
|
+
scale: dash.scale,
|
|
7275
|
+
rotation: dash.rotation,
|
|
7276
|
+
offsetX: dash.x_offset,
|
|
7277
|
+
offsetY: dash.y_offset,
|
|
7278
|
+
text: dash.text
|
|
7270
7279
|
});
|
|
7271
7280
|
});
|
|
7272
7281
|
return patterns;
|
|
@@ -7256,7 +7256,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
7256
7256
|
const description = libredwg.dwg_dynapi_entity_value(item, "description").data;
|
|
7257
7257
|
const numDashes = libredwg.dwg_dynapi_entity_value(item, "numdashes").data;
|
|
7258
7258
|
const patternLen = libredwg.dwg_dynapi_entity_value(item, "pattern_len").data;
|
|
7259
|
-
const
|
|
7259
|
+
const dashes = libredwg.dwg_dynapi_entity_value(item, "dashes").data;
|
|
7260
|
+
const dashArray = dashes ? libredwg.dwg_ptr_to_ltype_dash_array(dashes, numDashes) : [];
|
|
7260
7261
|
return {
|
|
7261
7262
|
...commonAttrs,
|
|
7262
7263
|
description,
|
|
@@ -7271,7 +7272,15 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
7271
7272
|
dashes.forEach((dash) => {
|
|
7272
7273
|
patterns.push({
|
|
7273
7274
|
elementLength: dash.length || 0,
|
|
7274
|
-
elementTypeFlag:
|
|
7275
|
+
elementTypeFlag: dash.complex_shapecode,
|
|
7276
|
+
shapeNumber: dash.shape_flag,
|
|
7277
|
+
// TODO: convert style handle to style object id
|
|
7278
|
+
// styleObjectId: dash.style,
|
|
7279
|
+
scale: dash.scale,
|
|
7280
|
+
rotation: dash.rotation,
|
|
7281
|
+
offsetX: dash.x_offset,
|
|
7282
|
+
offsetY: dash.y_offset,
|
|
7283
|
+
text: dash.text
|
|
7275
7284
|
});
|
|
7276
7285
|
});
|
|
7277
7286
|
return patterns;
|
|
@@ -540,9 +540,8 @@ export class LibreDwgConverter {
|
|
|
540
540
|
.data;
|
|
541
541
|
const patternLen = libredwg.dwg_dynapi_entity_value(item, 'pattern_len')
|
|
542
542
|
.data;
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
const dashArray = [];
|
|
543
|
+
const dashes = libredwg.dwg_dynapi_entity_value(item, 'dashes').data;
|
|
544
|
+
const dashArray = dashes ? libredwg.dwg_ptr_to_ltype_dash_array(dashes, numDashes) : [];
|
|
546
545
|
return {
|
|
547
546
|
...commonAttrs,
|
|
548
547
|
description: description,
|
|
@@ -555,10 +554,17 @@ export class LibreDwgConverter {
|
|
|
555
554
|
convertLineTypePattern(dashes) {
|
|
556
555
|
const patterns = [];
|
|
557
556
|
dashes.forEach(dash => {
|
|
558
|
-
// For now always convert complex line type to simple line type
|
|
559
557
|
patterns.push({
|
|
560
558
|
elementLength: dash.length || 0,
|
|
561
|
-
elementTypeFlag:
|
|
559
|
+
elementTypeFlag: dash.complex_shapecode,
|
|
560
|
+
shapeNumber: dash.shape_flag,
|
|
561
|
+
// TODO: convert style handle to style object id
|
|
562
|
+
// styleObjectId: dash.style,
|
|
563
|
+
scale: dash.scale,
|
|
564
|
+
rotation: dash.rotation,
|
|
565
|
+
offsetX: dash.x_offset,
|
|
566
|
+
offsetY: dash.y_offset,
|
|
567
|
+
text: dash.text
|
|
562
568
|
});
|
|
563
569
|
});
|
|
564
570
|
return patterns;
|
package/package.json
CHANGED