fix: img state

This commit is contained in:
baizn 2020-08-24 18:28:50 +08:00 committed by Moyee
parent 02771191a1
commit fc84e17255
2 changed files with 11 additions and 2 deletions

View File

@ -115,6 +115,7 @@
"jest-electron": "^0.1.7",
"jest-extended": "^0.11.2",
"lint-staged": "^10.2.11",
"pre-commit": "^1.2.2",
"prettier": "^2.0.5",
"react": "^16.13.1",
"react-dom": "^16.13.1",
@ -129,4 +130,4 @@
"webpack-cli": "^3.3.10",
"worker-loader": "^3.0.0"
}
}
}

View File

@ -312,7 +312,15 @@ export default class ItemBase implements IItemBase {
}
if (currentShape) {
return currentShape.attr();
const styles: ShapeStyle & Indexable<any> = {};
each(currentShape.attr(), (val, key) => {
// 修改 img 通过 updateItem 实现
if (key !== 'img') {
styles[key] = val;
}
});
return styles;
}
return {};
}