fix: 元素旋转后鼠标可选范围异常

This commit is contained in:
pipipi-pikachu 2021-04-26 19:36:45 +08:00
parent 8cbed39b96
commit 47b0b53d4b
5 changed files with 10 additions and 10 deletions

View File

@ -7,7 +7,6 @@
width: elementInfo.width + 'px', width: elementInfo.width + 'px',
height: elementInfo.height + 'px', height: elementInfo.height + 'px',
}" }"
@mousedown="$event => handleSelectElement($event)"
> >
<div <div
class="element-content" class="element-content"
@ -15,6 +14,7 @@
backgroundColor: elementInfo.fill, backgroundColor: elementInfo.fill,
}" }"
v-contextmenu="contextmenus" v-contextmenu="contextmenus"
@mousedown="$event => handleSelectElement($event)"
> >
<ElementOutline <ElementOutline
:width="elementInfo.width" :width="elementInfo.width"
@ -79,7 +79,6 @@ export default defineComponent({
<style lang="scss" scoped> <style lang="scss" scoped>
.editable-element-chart { .editable-element-chart {
position: absolute; position: absolute;
cursor: move;
&.lock .element-content { &.lock .element-content {
cursor: default; cursor: default;
@ -90,5 +89,6 @@ export default defineComponent({
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
cursor: move;
} }
</style> </style>

View File

@ -8,7 +8,6 @@
width: elementInfo.width + 'px', width: elementInfo.width + 'px',
height: elementInfo.height + 'px', height: elementInfo.height + 'px',
}" }"
@mousedown="$event => handleSelectElement($event)"
> >
<div <div
class="rotate-wrapper" class="rotate-wrapper"
@ -28,11 +27,12 @@
<div <div
class="element-content" class="element-content"
v-else v-else
v-contextmenu="contextmenus"
:style="{ :style="{
filter: shadowStyle ? `drop-shadow(${shadowStyle})` : '', filter: shadowStyle ? `drop-shadow(${shadowStyle})` : '',
transform: flipStyle, transform: flipStyle,
}" }"
v-contextmenu="contextmenus"
@mousedown="$event => handleSelectElement($event)"
> >
<ImageOutline :elementInfo="elementInfo" /> <ImageOutline :elementInfo="elementInfo" />

View File

@ -8,7 +8,6 @@
width: elementInfo.width + 'px', width: elementInfo.width + 'px',
height: elementInfo.height + 'px', height: elementInfo.height + 'px',
}" }"
@mousedown="$event => handleSelectElement($event)"
> >
<div <div
class="rotate-wrapper" class="rotate-wrapper"
@ -16,12 +15,13 @@
> >
<div <div
class="element-content" class="element-content"
v-contextmenu="contextmenus"
:style="{ :style="{
opacity: elementInfo.opacity, opacity: elementInfo.opacity,
filter: shadowStyle ? `drop-shadow(${shadowStyle})` : '', filter: shadowStyle ? `drop-shadow(${shadowStyle})` : '',
transform: flipStyle, transform: flipStyle,
}" }"
v-contextmenu="contextmenus"
@mousedown="$event => handleSelectElement($event)"
> >
<SvgWrapper <SvgWrapper
overflow="visible" overflow="visible"
@ -118,7 +118,6 @@ export default defineComponent({
<style lang="scss" scoped> <style lang="scss" scoped>
.editable-element-shape { .editable-element-shape {
position: absolute; position: absolute;
cursor: move;
&.lock .element-content { &.lock .element-content {
cursor: default; cursor: default;
@ -132,6 +131,7 @@ export default defineComponent({
width: 100%; width: 100%;
height: 100%; height: 100%;
position: relative; position: relative;
cursor: move;
svg { svg {
transform-origin: 0 0; transform-origin: 0 0;

View File

@ -190,7 +190,6 @@ export default defineComponent({
<style lang="scss" scoped> <style lang="scss" scoped>
.editable-element-table { .editable-element-table {
position: absolute; position: absolute;
cursor: move;
&.lock .element-content { &.lock .element-content {
cursor: default; cursor: default;
@ -201,6 +200,7 @@ export default defineComponent({
width: 100%; width: 100%;
height: 100%; height: 100%;
position: relative; position: relative;
cursor: move;
} }
.table-mask { .table-mask {
position: absolute; position: absolute;

View File

@ -8,7 +8,6 @@
left: elementInfo.left + 'px', left: elementInfo.left + 'px',
width: elementInfo.width + 'px', width: elementInfo.width + 'px',
}" }"
@mousedown="$event => handleSelectElement($event)"
> >
<div <div
class="rotate-wrapper" class="rotate-wrapper"
@ -24,6 +23,7 @@
letterSpacing: (elementInfo.wordSpace || 0) + 'px', letterSpacing: (elementInfo.wordSpace || 0) + 'px',
}" }"
v-contextmenu="contextmenus" v-contextmenu="contextmenus"
@mousedown="$event => handleSelectElement($event)"
> >
<ElementOutline <ElementOutline
:width="elementInfo.width" :width="elementInfo.width"
@ -323,7 +323,6 @@ export default defineComponent({
<style lang="scss" scoped> <style lang="scss" scoped>
.editable-element-text { .editable-element-text {
position: absolute; position: absolute;
cursor: move;
&.lock .element-content { &.lock .element-content {
cursor: default; cursor: default;
@ -338,6 +337,7 @@ export default defineComponent({
padding: 10px; padding: 10px;
line-height: 1.5; line-height: 1.5;
word-break: break-word; word-break: break-word;
cursor: move;
.text { .text {
position: relative; position: relative;