fix: 新增图层

This commit is contained in:
MTrun
2022-01-29 11:44:51 +08:00
parent a2a3a31df5
commit 3acf2fe732
14 changed files with 108 additions and 28 deletions
@@ -23,8 +23,7 @@ export const handleDrop = async (e: DragEvent) => {
// 创建新图表组件
let newComponent = await createComponent(dropData)
const { w, h } = dropData.chartData.chartSize
newComponent.setPosition(e.offsetX - w / 2, e.offsetY - h / 2)
newComponent.setPosition(e.offsetX - newComponent.attr.w / 2, e.offsetY - newComponent.attr.h / 2)
chartEditStore.addComponentList(newComponent)
loadingFinish()