Merge pull request #8033 from dataease/pr@dev-v2@fix_shape-move

fix(数据大屏): 修复组件角落处移动点保持宽高比拖动时出现闪动问题
This commit is contained in:
王嘉豪 2024-02-18 12:06:59 +08:00 committed by GitHub
commit 7f13cc605e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -232,6 +232,7 @@ const {
} = toRefs(props)
const domId = ref('shape-id-' + element.value.id)
const pointList = ['lt', 't', 'rt', 'r', 'rb', 'b', 'lb', 'l']
const pointCorner = ['lt', 'rt', 'rb', 'lb']
const pointList2 = ['r', 'l']
const initialAngle = {
//
@ -639,7 +640,9 @@ const handleMouseDownOnPoint = (point, e) => {
const adaptorWidthOffset = heightOffset * originRadio
//
const adaptorHeightOffset = widthOffset / originRadio
if (Math.abs(widthOffset) > Math.abs(adaptorWidthOffset)) {
if (pointCorner.includes(point)) {
style.height = defaultStyle.value.height + adaptorHeightOffset
} else if (Math.abs(widthOffset) > Math.abs(adaptorWidthOffset)) {
//
style.height = defaultStyle.value.height + adaptorHeightOffset
} else {