fl-web-component 2.1.6 → 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
|
@@ -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
|
-
|
|
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
|
-
|
|
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;
|