File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -17,19 +17,19 @@ import type { MindElixirInstance } from './types/index'
1717const linkDiv = function ( this : MindElixirInstance , mainNode ?: Wrapper ) {
1818 console . time ( 'linkDiv' )
1919
20- // pin center
21- this . nodes . style . top = `${ 10000 - this . nodes . offsetHeight / 2 } px`
22- this . nodes . style . left = `${ 10000 - this . nodes . offsetWidth / 2 } px`
23-
24- const mainNodeList = this . map . querySelectorAll ( 'me-main > me-wrapper' )
25- this . lines . innerHTML = ''
26-
2720 const root = this . map . querySelector ( 'me-root' ) as HTMLElement
2821 const pT = root . offsetTop
2922 const pL = root . offsetLeft
3023 const pW = root . offsetWidth
3124 const pH = root . offsetHeight
3225
26+ // pin center
27+ this . nodes . style . top = `${ 10000 - this . nodes . offsetHeight / 2 } px`
28+ this . nodes . style . left = `${ 10000 - pL - pW / 2 } px`
29+
30+ const mainNodeList = this . map . querySelectorAll ( 'me-main > me-wrapper' )
31+ this . lines . innerHTML = ''
32+
3333 for ( let i = 0 ; i < mainNodeList . length ; i ++ ) {
3434 const el = mainNodeList [ i ] as Wrapper
3535 const tpc = el . querySelector < Topic > ( 'me-tpc' ) as Topic
You can’t perform that action at this time.
0 commit comments