Skip to content

Commit 5f737f8

Browse files
committed
fix: amend resize point position
1 parent 3dce322 commit 5f737f8

File tree

1 file changed

+4
-2
lines changed
  • front-end/h5/src/components/core/support

1 file changed

+4
-2
lines changed

front-end/h5/src/components/core/support/shape.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ export default {
2525
*/
2626
getPointStyle (point, isWrapElement = true) {
2727
const pos = this.position
28-
const top = pos.top - 4 // !#zh 减4是为了让元素能够处于 border 的中间
29-
const left = pos.left - 4
28+
const top = pos.top // !#zh 减4是为了让元素能够处于 border 的中间
29+
const left = pos.left
3030
const height = pos.height
3131
const width = pos.width
3232
let hasT = /t/.test(point)
@@ -51,6 +51,8 @@ export default {
5151
}
5252
}
5353
const style = {
54+
marginLeft: (hasL || hasR) ? '-3px' : 0,
55+
marginTop: (hasT || hasB) ? '-3px' : 0,
5456
left: `${newLeft + (isWrapElement ? 0 : left)}px`,
5557
top: `${newTop + (isWrapElement ? 0 : top)}px`,
5658
cursor: point.split('').reverse().map(m => directionKey[m]).join('') + '-resize'

0 commit comments

Comments
 (0)