|
@@ -5,6 +5,7 @@ import { defineComponent } from "vue";
|
|
|
import { string } from "vue-types";
|
|
|
import { useEditor } from "../../..";
|
|
|
import { useCompRef } from "./hooks";
|
|
|
+import { CompObject } from "@/modules/editor/controllers/SelectCtrl/compObj";
|
|
|
|
|
|
export const View = defineComponent({
|
|
|
props: {
|
|
@@ -20,6 +21,9 @@ export const View = defineComponent({
|
|
|
if (!comp) return store.isEditMode ? <div>无效组件</div> : null;
|
|
|
const isStreamCard = helper.isStreamCard(props.compId);
|
|
|
const isGroupComp = helper.isGroupComp(props.compId);
|
|
|
+ const obj =new CompObject(store.compMap[props.compId])
|
|
|
+ const m = obj.worldTransform.clone();
|
|
|
+ m.invert();
|
|
|
|
|
|
return (
|
|
|
<div
|
|
@@ -39,17 +43,15 @@ export const View = defineComponent({
|
|
|
onDblclick={() => emit("dblclick")}
|
|
|
>
|
|
|
<div
|
|
|
- // onMousedown={(e) => {
|
|
|
- // if (helper.isGroupCompChild(props.compId)) return;
|
|
|
+ onMousedown={(e) => {
|
|
|
+ if (helper.isGroupCompChild(props.compId)) return;
|
|
|
+ e.stopPropagation();
|
|
|
+
|
|
|
+ if (store.isEditMode) {
|
|
|
+ actions.pickComp(props.compId);
|
|
|
+ }
|
|
|
+ }}
|
|
|
|
|
|
- // // e.stopPropagation();
|
|
|
- // if (store.isEditMode) {
|
|
|
- // actions.pickComp(props.compId);
|
|
|
- // if (!helper.isStreamCard(props.compId)) {
|
|
|
- // controls.transferCtrl.mousedown(e, "move", store.currComp);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }}
|
|
|
onMousemove={(e) => {
|
|
|
if (
|
|
|
!store.isEditMode ||
|
|
@@ -60,6 +62,7 @@ export const View = defineComponent({
|
|
|
actions.pickComp(props.compId);
|
|
|
}}
|
|
|
>
|
|
|
+
|
|
|
{slots.default?.()}
|
|
|
</div>
|
|
|
|