|
@@ -536,18 +536,19 @@ const dragStart = async (event: DragEvent | MouseEvent, item: any) => {
|
|
let target: any = event.target;
|
|
let target: any = event.target;
|
|
target.children[0] && (target = target.children[0].children[0]);
|
|
target.children[0] && (target = target.children[0].children[0]);
|
|
// firefox naturalWidth svg 图片 可能是 0
|
|
// firefox naturalWidth svg 图片 可能是 0
|
|
- const normalWidth = target.naturalWidth || target.width;
|
|
|
|
- const normalHeight = target.naturalHeight || target.height;
|
|
|
|
|
|
+ const width = target.naturalWidth || target.width;
|
|
|
|
+ const height = target.naturalHeight || target.height;
|
|
const [name, lockedOnCombine] = isGif(item.image)
|
|
const [name, lockedOnCombine] = isGif(item.image)
|
|
? ['gif', 0]
|
|
? ['gif', 0]
|
|
: ['image', undefined];
|
|
: ['image', undefined];
|
|
|
|
|
|
data = {
|
|
data = {
|
|
name,
|
|
name,
|
|
- width: 100,
|
|
|
|
- height: 100 * (normalHeight / normalWidth),
|
|
|
|
|
|
+ width,
|
|
|
|
+ height,
|
|
image: item.image,
|
|
image: item.image,
|
|
imageRatio: true,
|
|
imageRatio: true,
|
|
|
|
+ ratio: true,
|
|
lockedOnCombine,
|
|
lockedOnCombine,
|
|
};
|
|
};
|
|
} else {
|
|
} else {
|
|
@@ -590,6 +591,7 @@ const open = async (item: any) => {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ sessionStorage.setItem('opening', '1');
|
|
router.push({
|
|
router.push({
|
|
path: '/',
|
|
path: '/',
|
|
query: {
|
|
query: {
|
|
@@ -600,9 +602,9 @@ const open = async (item: any) => {
|
|
for (const k of delAttrs) {
|
|
for (const k of delAttrs) {
|
|
delete ret[k];
|
|
delete ret[k];
|
|
}
|
|
}
|
|
-
|
|
|
|
autoSave();
|
|
autoSave();
|
|
meta2d.open(ret);
|
|
meta2d.open(ret);
|
|
|
|
+ meta2d.fitView();
|
|
};
|
|
};
|
|
|
|
|
|
const getPrivateGraphics = async () => {
|
|
const getPrivateGraphics = async () => {
|