@@ -12,6 +12,7 @@ import type { MouseEvent } from "../event/mouse";
12
12
import type { ResizeType } from "../types/dom" ;
13
13
import { noZero } from "../utils/cipher" ;
14
14
import {
15
+ FINE_TUNE ,
15
16
MAX_Z_INDEX ,
16
17
RESIZE_LEN ,
17
18
RESIZE_OFS ,
@@ -72,28 +73,48 @@ export class ResizeNode extends Node {
72
73
const range = Range . from ( startX , startY , startX , endY ) ;
73
74
const { x, y } = range . center ( ) ;
74
75
const offset = RESIZE_OFS / 2 ;
75
- target = Range . from ( x - offset , y - RESIZE_OFS , x + offset , y + RESIZE_OFS ) ;
76
+ target = Range . from (
77
+ x - offset - FINE_TUNE ,
78
+ y - RESIZE_OFS ,
79
+ x + offset - FINE_TUNE ,
80
+ y + RESIZE_OFS
81
+ ) ;
76
82
break ;
77
83
}
78
84
case RESIZE_TYPE . R : {
79
85
const range = Range . from ( endX , startY , endX , endY ) ;
80
86
const { x, y } = range . center ( ) ;
81
87
const offset = RESIZE_OFS / 2 ;
82
- target = Range . from ( x - offset , y - RESIZE_OFS , x + offset , y + RESIZE_OFS ) ;
88
+ target = Range . from (
89
+ x - offset + FINE_TUNE ,
90
+ y - RESIZE_OFS ,
91
+ x + offset + FINE_TUNE ,
92
+ y + RESIZE_OFS
93
+ ) ;
83
94
break ;
84
95
}
85
96
case RESIZE_TYPE . T : {
86
97
const range = Range . from ( startX , startY , endX , startY ) ;
87
98
const { x, y } = range . center ( ) ;
88
99
const offset = RESIZE_OFS / 2 ;
89
- target = Range . from ( x - RESIZE_OFS , y - offset , x + RESIZE_OFS , y + offset ) ;
100
+ target = Range . from (
101
+ x - RESIZE_OFS ,
102
+ y - offset - FINE_TUNE ,
103
+ x + RESIZE_OFS ,
104
+ y + offset - FINE_TUNE
105
+ ) ;
90
106
break ;
91
107
}
92
108
case RESIZE_TYPE . B : {
93
109
const range = Range . from ( startX , endY , endX , endY ) ;
94
110
const { x, y } = range . center ( ) ;
95
111
const offset = RESIZE_OFS / 2 ;
96
- target = Range . from ( x - RESIZE_OFS , y - offset , x + RESIZE_OFS , y + offset ) ;
112
+ target = Range . from (
113
+ x - RESIZE_OFS ,
114
+ y - offset + FINE_TUNE ,
115
+ x + RESIZE_OFS ,
116
+ y + offset + FINE_TUNE
117
+ ) ;
97
118
break ;
98
119
}
99
120
}
0 commit comments