This commit is contained in:
pipipi-pikachu 2020-12-25 09:49:10 +08:00
parent 636c27c37e
commit 41ad4b1869
3 changed files with 7 additions and 24 deletions

View File

@ -9,7 +9,7 @@
height: elementInfo.height + 'px', height: elementInfo.height + 'px',
transform: `rotate(${elementInfo.rotate}deg)`, transform: `rotate(${elementInfo.rotate}deg)`,
}" }"
@mousedown="handleSelectElement($event)" @mousedown="$event => handleSelectElement($event)"
> >
<ImageClip <ImageClip
v-if="isCliping" v-if="isCliping"
@ -94,7 +94,7 @@
:key="point.direction" :key="point.direction"
:type="point.direction" :type="point.direction"
:style="point.style" :style="point.style"
@mousedown.stop="scaleElement($event, elementInfo, point.direction)" @mousedown.stop="$event => scaleElement($event, elementInfo, point.direction)"
/> />
<RotateHandler <RotateHandler
class="operate-rotate-handler" class="operate-rotate-handler"
@ -294,14 +294,6 @@ export default defineComponent({
.editable-element-image { .editable-element-image {
position: absolute; position: absolute;
&.lock .operate-border-line {
border-color: #888;
}
&:hover .operate-border-line {
display: block;
}
&.lock .element-content { &.lock .element-content {
cursor: default; cursor: default;
} }

View File

@ -8,7 +8,7 @@
width: elementInfo.width + 'px', width: elementInfo.width + 'px',
transform: `rotate(${elementInfo.rotate}deg)`, transform: `rotate(${elementInfo.rotate}deg)`,
}" }"
@mousedown="handleSelectElement($event, false)" @mousedown="$event => handleSelectElement($event)"
> >
<div class="element-content" <div class="element-content"
:style="{ :style="{
@ -26,6 +26,7 @@
<div class="text" <div class="text"
v-html="elementInfo.content" v-html="elementInfo.content"
:contenteditable="isActive && !elementInfo.lock" :contenteditable="isActive && !elementInfo.lock"
@mousedown="$event => handleSelectElement($event, false)"
></div> ></div>
</div> </div>
@ -37,7 +38,6 @@
'active': isActive, 'active': isActive,
}" }"
:style="{ transform: `scale(${1 / canvasScale})` }" :style="{ transform: `scale(${1 / canvasScale})` }"
v-contextmenu="contextmenus"
> >
<BorderLine <BorderLine
class="operate-border-line" class="operate-border-line"
@ -45,8 +45,6 @@
:key="line.type" :key="line.type"
:type="line.type" :type="line.type"
:style="line.style" :style="line.style"
:isWide="true"
@mousedown="handleSelectElement($event)"
/> />
<template v-if="!elementInfo.lock && (isActiveGroupElement || !isMultiSelect)"> <template v-if="!elementInfo.lock && (isActiveGroupElement || !isMultiSelect)">
<ResizeHandler <ResizeHandler
@ -55,7 +53,7 @@
:key="point.direction" :key="point.direction"
:type="point.direction" :type="point.direction"
:style="point.style" :style="point.style"
@mousedown.stop="scaleElement($event, elementInfo, point.direction)" @mousedown.stop="$event => scaleElement($event, elementInfo, point.direction)"
/> />
<RotateHandler <RotateHandler
class="operate-rotate-handler" class="operate-rotate-handler"
@ -168,14 +166,7 @@ export default defineComponent({
<style lang="scss" scoped> <style lang="scss" scoped>
.editable-element-text { .editable-element-text {
position: absolute; position: absolute;
cursor: move;
&.lock .operate-border-line {
border-color: #888;
}
&:hover .operate-border-line {
display: block;
}
&.lock .element-content { &.lock .element-content {
cursor: default; cursor: default;

View File

@ -5,7 +5,7 @@ export default (shadow: Ref<PPTElementShadow | undefined>) => {
let shadowStyle = '' let shadowStyle = ''
if(shadow.value) { if(shadow.value) {
const { h, v, blur, color } = shadow.value const { h, v, blur, color } = shadow.value
shadowStyle = `${h} ${v} ${blur} ${color}` shadowStyle = `${h}px ${v}px ${blur}px ${color}`
} }
return { return {