fl-web-component 2.1.5 → 2.1.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fl-web-component",
3
- "version": "2.1.5",
3
+ "version": "2.1.7",
4
4
  "scripts": {
5
5
  "postinstall": "patch-package",
6
6
  "tip1": "仅调试本组件不涉及业务组件,请执行dev",
@@ -52,9 +52,9 @@ export function handleFn(functionName, recordDxf, entity, group, key, configPara
52
52
  case 'ELLIPSE':
53
53
  drawEllpse(recordDxf, entity, group, key, configParams);
54
54
  break;
55
- case 'HATCH':
56
- drawHatch(recordDxf, entity, group, key, configParams);
57
- break;
55
+ // case 'HATCH':
56
+ // drawHatch(recordDxf, entity, group, key, configParams);
57
+ // break;
58
58
  //case 'MTEXT': drawMtext(recordDxf, entity, group, key, configParams)
59
59
  //break;
60
60
  case 'SPLINE':
@@ -1202,13 +1202,23 @@ export class StreamLoader {
1202
1202
  }
1203
1203
 
1204
1204
  if (dataView.byteLength < offset + 4) throw new Error('Insufficient data for Fontsize');
1205
- primitive.fontsize = dataView.getInt32(offset, false);
1205
+ const fontsize = dataView.getInt32(offset, false);
1206
1206
  offset += 4;
1207
1207
 
1208
1208
  if (dataView.byteLength < offset + 8) throw new Error('Insufficient data for Widthscale');
1209
- primitive.widthscale = dataView.getFloat64(offset, false);
1209
+ const widthscale = dataView.getFloat64(offset, false);
1210
1210
  offset += 8;
1211
1211
 
1212
+ const widthscaleDecimalPart = String(widthscale).split('.')[1] || '';
1213
+ const isRedundantTextScale = fontsize < 10 && widthscaleDecimalPart.length > 3;
1214
+ if (!isRedundantTextScale) {
1215
+ primitive.fontsize = fontsize;
1216
+ primitive.widthscale = widthscale;
1217
+ } else {
1218
+ // 当前读取内容属于后续字段,回退偏移后按后续字段格式继续解析。
1219
+ offset -= 12;
1220
+ }
1221
+
1212
1222
  if (dataView.byteLength < offset + 4) throw new Error('Insufficient data for DataType length');
1213
1223
  const dataTypeLen = dataView.getUint32(offset, false);
1214
1224
  offset += 4;