fl-web-component 1.3.16 → 1.3.17
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/fl-web-component.common.js +579 -42
- package/dist/fl-web-component.common.js.map +1 -1
- package/dist/fl-web-component.css +1 -1
- package/package.json +1 -1
- package/packages/components/com-flcanvas/components/entityFormatting.js +379 -100
- package/packages/components/com-flcanvas/index.vue +13 -5
|
@@ -129,11 +129,17 @@
|
|
|
129
129
|
//销毁方法
|
|
130
130
|
|
|
131
131
|
methods: {
|
|
132
|
+
//思路是计算居中包围盒,然后排除脏数据。
|
|
132
133
|
loadDxf(data){
|
|
133
134
|
|
|
135
|
+
/* if(this.layer!=null){
|
|
136
|
+
let nodes=this.layer.find(".item");
|
|
137
|
+
for(let i=0;i<nodes.length;i++){
|
|
138
|
+
nodes[i].destroy();
|
|
139
|
+
}
|
|
140
|
+
}*/
|
|
134
141
|
|
|
135
|
-
|
|
136
|
-
|
|
142
|
+
konvaLayer.destroyChildren();
|
|
137
143
|
const parser = new DxfParser();
|
|
138
144
|
let dxf = parser.parse(data);
|
|
139
145
|
let entities = formatEntity(dxf.entities);
|
|
@@ -160,6 +166,7 @@
|
|
|
160
166
|
for(let i = 0; i < group.length;i++) {
|
|
161
167
|
let entity = group[i];
|
|
162
168
|
if (entity.type === 'text') {
|
|
169
|
+
|
|
163
170
|
if (konvaLayer) konvaLayer.add(entity.obj);
|
|
164
171
|
}
|
|
165
172
|
}
|
|
@@ -282,13 +289,14 @@
|
|
|
282
289
|
// get data URL with default settings
|
|
283
290
|
|
|
284
291
|
// open in new window
|
|
285
|
-
konvaLayer.getCanvas().setPixelRatio(
|
|
292
|
+
konvaLayer.getCanvas().setPixelRatio(2);
|
|
286
293
|
const jpegURL = konvaStage.toDataURL({
|
|
287
294
|
mimeType: 'image/jpeg',
|
|
288
|
-
quality:1
|
|
295
|
+
quality:1,
|
|
296
|
+
pixelRatio:2
|
|
289
297
|
});
|
|
290
298
|
|
|
291
|
-
let pageData=konvaLayer.canvas.toDataURL('image/jpeg',
|
|
299
|
+
let pageData=konvaLayer.canvas.toDataURL('image/jpeg', 2);
|
|
292
300
|
|
|
293
301
|
|
|
294
302
|
let img = new Image();
|