|
@@ -974,13 +974,17 @@ const openSvg = async (file: File) => {
|
|
|
const text = await readFile(file);
|
|
|
const pens: Pen[] = parseSvg(text);
|
|
|
if(pens.length){
|
|
|
- if(pens[0].width>100||pens[0].height>100){
|
|
|
- if(pens[0].width>pens[0].height){
|
|
|
- pens[0].height = pens[0].height/pens[0].width*100;
|
|
|
- pens[0].width = 100;
|
|
|
- }else{
|
|
|
- pens[0].width = pens[0].width/pens[0].height*100;
|
|
|
- pens[0].height = 100;
|
|
|
+ if(pens.length>100){
|
|
|
+ //认为是大图
|
|
|
+ }else{
|
|
|
+ if(pens[0].width>100||pens[0].height>100){
|
|
|
+ if(pens[0].width>pens[0].height){
|
|
|
+ pens[0].height = pens[0].height/pens[0].width*100;
|
|
|
+ pens[0].width = 100;
|
|
|
+ }else{
|
|
|
+ pens[0].width = pens[0].width/pens[0].height*100;
|
|
|
+ pens[0].height = 100;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|