|
@@ -10,15 +10,20 @@ export const editActions = EditorModule.action({
|
|
|
// 通过拖拽添加组件到画布
|
|
|
async dragCompToDesign(event: MouseEvent, compKey: ICompKeys) {
|
|
|
await this.actions.addCompToDesign(compKey);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
const cardPoints = this.helper.getPointOffsetWith(
|
|
|
event,
|
|
|
this.store.currStreamCard.$el
|
|
|
);
|
|
|
const { currComp } = this.store;
|
|
|
- currComp.translate(
|
|
|
- 375 - (currComp.layout.size?.[0] || 750) / 2,
|
|
|
- this.helper.pxToDesignSize(cardPoints.y)
|
|
|
- );
|
|
|
+ let selCtrl = this.controls.selectCtrl
|
|
|
+ selCtrl.selecteObjs([new CompObject(currComp) ])
|
|
|
+ selCtrl.translate(this.helper.designSizeToPx(375 - (currComp.layout.size?.[0] || 750) / 2), cardPoints.y);
|
|
|
+
|
|
|
+ this.helper.extendStreamCard(this.store.currStreamCardId);
|
|
|
+
|
|
|
},
|
|
|
// 通过点击添加组件到画布
|
|
|
async clickCompToDesign(compKey: ICompKeys) {
|