Commit 5f737f811acef769d623d6c2ed888ff24c192b71

Authored by ly525
1 parent 3dce3225

fix: amend resize point position

front-end/h5/src/components/core/support/shape.js
@@ -25,8 +25,8 @@ export default { @@ -25,8 +25,8 @@ export default {
25 */ 25 */
26 getPointStyle (point, isWrapElement = true) { 26 getPointStyle (point, isWrapElement = true) {
27 const pos = this.position 27 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
30 const height = pos.height 30 const height = pos.height
31 const width = pos.width 31 const width = pos.width
32 let hasT = /t/.test(point) 32 let hasT = /t/.test(point)
@@ -51,6 +51,8 @@ export default { @@ -51,6 +51,8 @@ export default {
51 } 51 }
52 } 52 }
53 const style = { 53 const style = {
  54 + marginLeft: (hasL || hasR) ? '-3px' : 0,
  55 + marginTop: (hasT || hasB) ? '-3px' : 0,
54 left: `${newLeft + (isWrapElement ? 0 : left)}px`, 56 left: `${newLeft + (isWrapElement ? 0 : left)}px`,
55 top: `${newTop + (isWrapElement ? 0 : top)}px`, 57 top: `${newTop + (isWrapElement ? 0 : top)}px`,
56 cursor: point.split('').reverse().map(m => directionKey[m]).join('') + '-resize' 58 cursor: point.split('').reverse().map(m => directionKey[m]).join('') + '-resize'