|
@@ -39,32 +39,26 @@ export const SelectTransfer = defineComponent({
|
|
|
});
|
|
|
});
|
|
|
|
|
|
- const scaleFlagRef = ref();
|
|
|
-
|
|
|
return () => {
|
|
|
+ if (selectCtrl.transferStyle.showOrthScale) {
|
|
|
+ nextTick(() => {
|
|
|
+ scaleRightRef.value.editable = "scaleright";
|
|
|
+ scaleLeftRef.value.editable = "scaleleft";
|
|
|
+ scaleTopRef.value.editable = "scaletop";
|
|
|
+ scaleBottomRef.value.editable = "scalebottom";
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
- if (selectCtrl.transferStyle.showOrthScale && !scaleFlagRef.value) {
|
|
|
- scaleFlagRef.value = true
|
|
|
- nextTick(()=>{
|
|
|
- scaleRightRef.value.editable = "scaleright";
|
|
|
- scaleLeftRef.value.editable = "scaleleft";
|
|
|
- scaleTopRef.value.editable = "scaletop";
|
|
|
- scaleBottomRef.value.editable = "scalebottom";
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- let toolbarOpts = CompToolbars.default
|
|
|
- let comp :any= null;
|
|
|
+ let toolbarOpts = CompToolbars.default;
|
|
|
+ let comp: any = null;
|
|
|
if (selectCtrl.selected.length == 1) {
|
|
|
- comp = selectCtrl.selected[0].comp;
|
|
|
+ comp = selectCtrl.selected[0].comp;
|
|
|
//@ts-ignore
|
|
|
toolbarOpts = CompToolbars[comp.compKey] || toolbarOpts;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
const w = selectCtrl.objContainer?.getBound();
|
|
|
-
|
|
|
+
|
|
|
return (
|
|
|
<div
|
|
|
class={[
|
|
@@ -72,20 +66,23 @@ export const SelectTransfer = defineComponent({
|
|
|
transferStyle.showGizmo ? showgizmo : hideGizmo,
|
|
|
]}
|
|
|
>
|
|
|
- <div class={toolbarStyle} style={{
|
|
|
- top: w?.y + "px",
|
|
|
- left: w?.x + "px",
|
|
|
- }}>
|
|
|
-
|
|
|
- {comp && toolbarOpts.map((item) => {
|
|
|
- return item.getVisible.call(editor, comp) ? (
|
|
|
- <item.component
|
|
|
- class="p-4px"
|
|
|
- value={item.getValue?.(comp)}
|
|
|
- onClick={() => item.onClick.call(editor, comp)}
|
|
|
- />
|
|
|
- ) : null;
|
|
|
- })}
|
|
|
+ <div
|
|
|
+ class={toolbarStyle}
|
|
|
+ style={{
|
|
|
+ top: w?.y + "px",
|
|
|
+ left: w?.x + "px",
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {comp &&
|
|
|
+ toolbarOpts.map((item) => {
|
|
|
+ return item.getVisible.call(editor, comp) ? (
|
|
|
+ <item.component
|
|
|
+ class="p-4px"
|
|
|
+ value={item.getValue?.(comp)}
|
|
|
+ onClick={() => item.onClick.call(editor, comp)}
|
|
|
+ />
|
|
|
+ ) : null;
|
|
|
+ })}
|
|
|
</div>
|
|
|
|
|
|
<div
|
|
@@ -132,30 +129,30 @@ export const SelectTransfer = defineComponent({
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- {
|
|
|
-
|
|
|
- transferStyle.showOrthScale && <div
|
|
|
- class={[resizeHeightBtnCls, scaleTopCls]}
|
|
|
- ref={scaleTopRef}
|
|
|
- />
|
|
|
- }
|
|
|
- {
|
|
|
- transferStyle.showOrthScale && <div
|
|
|
- class={[resizeHeightBtnCls, scaleBottomCls]}
|
|
|
- ref={scaleBottomRef}
|
|
|
- />
|
|
|
- }
|
|
|
- {
|
|
|
- transferStyle.showOrthScale && <div
|
|
|
- class={[resizeWidthBtnCls, scaleRightCls]}
|
|
|
- ref={scaleRightRef}
|
|
|
- />
|
|
|
- }
|
|
|
- { transferStyle.showOrthScale && <div
|
|
|
- class={[resizeWidthBtnCls, scaleLeftCls]}
|
|
|
- ref={scaleLeftRef}
|
|
|
- />
|
|
|
- }
|
|
|
+ {transferStyle.showOrthScale && (
|
|
|
+ <div
|
|
|
+ class={[resizeHeightBtnCls, scaleTopCls]}
|
|
|
+ ref={scaleTopRef}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ {transferStyle.showOrthScale && (
|
|
|
+ <div
|
|
|
+ class={[resizeHeightBtnCls, scaleBottomCls]}
|
|
|
+ ref={scaleBottomRef}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ {transferStyle.showOrthScale && (
|
|
|
+ <div
|
|
|
+ class={[resizeWidthBtnCls, scaleRightCls]}
|
|
|
+ ref={scaleRightRef}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ {transferStyle.showOrthScale && (
|
|
|
+ <div
|
|
|
+ class={[resizeWidthBtnCls, scaleLeftCls]}
|
|
|
+ ref={scaleLeftRef}
|
|
|
+ />
|
|
|
+ )}
|
|
|
</>
|
|
|
</div>
|
|
|
</div>
|