@@ -11,9 +11,6 @@ import {
11
11
import {
12
12
useAuthStore ,
13
13
} from "src/store.js"
14
- import {
15
- useViewStateStore ,
16
- } from "src/layout.js"
17
14
import {
18
15
StompContext ,
19
16
tfetch ,
@@ -193,37 +190,22 @@ function SplitPane({className, messageRef, topElement, bottomElement}) {
193
190
}
194
191
195
192
function SplitBar ( { splitPos, dragOffset, onMouseDown, container} ) {
196
- let dragging = useViewStateStore ( state => state . dragging )
197
193
if ( ! container ) {
198
194
return < div />
199
195
}
200
- let innerHeight = Math . trunc ( getRemInPixel ( ) * 0.5 )
201
196
let rect = container . getBoundingClientRect ( )
202
197
let parentRect = container . offsetParent . getBoundingClientRect ( )
203
- let width = dragging ? 2 * rect . width : rect . width
204
- let left = rect . left - parentRect . left
205
- let lineClass = twJoin (
206
- "absolute h-[1px] z-20 cursor-row-resize" ,
207
- "bg-transparent" ,
208
- )
209
- let barClass = twJoin (
210
- "absolute z-20 cursor-row-resize" ,
211
- "bg-transparent" ,
212
- )
213
- return < >
214
- < div
215
- onMouseDown = { Number . isNaN ( dragOffset ) ? onMouseDown : undefined }
216
- style = { { top : Math . trunc ( splitPos ) , height : 1 , width : width , left : left } }
217
- className = { lineClass } />
218
- < div
219
- onMouseDown = { Number . isNaN ( dragOffset ) ? onMouseDown : undefined }
220
- style = { { top : Math . trunc ( splitPos + 1 ) , height : innerHeight , width : width , left : left } }
221
- className = { barClass } />
198
+ return (
222
199
< div
223
200
onMouseDown = { Number . isNaN ( dragOffset ) ? onMouseDown : undefined }
224
- style = { { top : Math . trunc ( splitPos + innerHeight + 1 ) , height : 1 , width : width , left : left } }
225
- className = { lineClass } />
226
- </ >
201
+ style = { {
202
+ top : Math . trunc ( splitPos ) - 1 ,
203
+ height : Math . trunc ( getRemInPixel ( ) * 0.5 ) + 2 ,
204
+ width : rect . width ,
205
+ left : rect . left - parentRect . left ,
206
+ } }
207
+ className = "absolute z-20 cursor-row-resize bg-transparent" />
208
+ )
227
209
}
228
210
229
211
function getSplitPos ( clientY , container ) {
0 commit comments