优化线条的鼠标操作范围

This commit is contained in:
pipipi-pikachu 2021-01-30 10:53:48 +08:00
parent 081a092db4
commit df23eb6870

View File

@ -6,11 +6,9 @@
top: elementInfo.top + 'px',
left: elementInfo.left + 'px',
}"
@mousedown="$event => handleSelectElement($event)"
>
<div
class="element-content"
v-contextmenu="contextmenus"
:style="{ filter: shadowStyle ? `drop-shadow(${shadowStyle})` : '' }"
>
<SvgWrapper
@ -47,6 +45,15 @@
stroke-miterlimit
:marker-start="elementInfo.points[0] ? `url(#${elementInfo.id}-${elementInfo.points[0]}-start)` : ''"
:marker-end="elementInfo.points[1] ? `url(#${elementInfo.id}-${elementInfo.points[1]}-end)` : ''"
></path>
<path
class="line-path"
:d="path"
stroke="transparent"
stroke-width="20"
fill="none"
@mousedown="$event => handleSelectElement($event)"
v-contextmenu="contextmenus"
></path>
</SvgWrapper>
</div>
@ -121,9 +128,8 @@ export default defineComponent({
<style lang="scss" scoped>
.editable-element-shape {
position: absolute;
cursor: move;
&.lock .element-content {
&.lock .line-path {
cursor: default;
}
}
@ -138,4 +144,7 @@ export default defineComponent({
overflow: visible;
}
}
.line-path {
cursor: move;
}
</style>