From a1e0d54c69db08b468edf3183702e207aaba4b3a Mon Sep 17 00:00:00 2001 From: 1549469775 <1549469775@qq.com> Date: Sat, 26 Dec 2020 17:51:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=B3=E8=BE=B9=E7=BC=98=E5=92=8C=E4=B8=8B?= =?UTF-8?q?=E8=BE=B9=E7=BC=98=E5=90=B8=E9=99=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ui/editor/MakeLine.vue | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/ui/editor/MakeLine.vue b/src/ui/editor/MakeLine.vue index 9186a75..2368591 100644 --- a/src/ui/editor/MakeLine.vue +++ b/src/ui/editor/MakeLine.vue @@ -52,16 +52,28 @@ export default { }, listenerChange(list, index, cb) { const activeStyle = list[index].style; + const screenWidth = this.$parent.$el.offsetWidth + const screenHeight = this.$parent.$el.offsetHeight // 上边缘 if (Math.abs(activeStyle.top) <= value) { activeStyle.top = 0; cb && cb(list[index], index); } + // 下边缘 + if (Math.abs(activeStyle.top+activeStyle.height - screenHeight) <= value) { + activeStyle.top = screenHeight - activeStyle.height; + cb && cb(list[index], index); + } // 左边缘 if (Math.abs(activeStyle.left) <= value) { activeStyle.left = 0; cb && cb(list[index], index); } + // 右边缘 + if (Math.abs(activeStyle.left+activeStyle.width-screenWidth) <= value) { + activeStyle.left = screenWidth - activeStyle.width; + cb && cb(list[index], index); + } if (list.length==1) { return }