diff --git a/core/core-frontend/src/custom-component/common/DeRuler.vue b/core/core-frontend/src/custom-component/common/DeRuler.vue index 0624526f2f..a12441b9ae 100644 --- a/core/core-frontend/src/custom-component/common/DeRuler.vue +++ b/core/core-frontend/src/custom-component/common/DeRuler.vue @@ -21,12 +21,43 @@ const props = defineProps({ const labelInterval = 5 -const { canvasStyleData } = storeToRefs(dvMainStore) +const { canvasStyleData, curComponent } = storeToRefs(dvMainStore) const rulerSize = computed(() => props.direction === 'horizontal' ? canvasStyleData.value.width : canvasStyleData.value.height ) +const curComponentSize = computed(() => { + if (curComponent.value) { + return ( + ((props.direction === 'horizontal' + ? curComponent.value.style.width + : curComponent.value.style.height) * + canvasStyleData.value.scale) / + 100 + ) + } else { + return 0 + } +}) + +const curComponentShadow = computed(() => { + if (curComponent.value) { + return { + left: + (props.direction === 'horizontal' + ? curComponent.value.style.left + : curComponent.value.style.top) + 'px', + width: + (props.direction === 'horizontal' + ? curComponent.value.style.width + : curComponent.value.style.height) + 'px' + } + } else { + return {} + } +}) + const ticks = computed(() => { const result = [] let currentValue = 0 @@ -84,6 +115,7 @@ defineExpose({
+