fix(svelte): use node.style.width and node.style
This commit is contained in:
@@ -48,16 +48,12 @@ const initialNodes: Node[] = [
|
|||||||
position: Position.Bottom,
|
position: Position.Bottom,
|
||||||
x: nodeSize.width * 0.5,
|
x: nodeSize.width * 0.5,
|
||||||
y: nodeSize.height,
|
y: nodeSize.height,
|
||||||
width: 1,
|
|
||||||
height: 1,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'target',
|
type: 'target',
|
||||||
position: Position.Top,
|
position: Position.Top,
|
||||||
x: nodeSize.width * 0.5,
|
x: nodeSize.width * 0.5,
|
||||||
y: 0,
|
y: 0,
|
||||||
width: 1,
|
|
||||||
height: 1,
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -72,16 +68,12 @@ const initialNodes: Node[] = [
|
|||||||
position: Position.Bottom,
|
position: Position.Bottom,
|
||||||
x: nodeSize.width * 0.5,
|
x: nodeSize.width * 0.5,
|
||||||
y: nodeSize.height,
|
y: nodeSize.height,
|
||||||
width: 1,
|
|
||||||
height: 1,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'target',
|
type: 'target',
|
||||||
position: Position.Top,
|
position: Position.Top,
|
||||||
x: nodeSize.width * 0.5,
|
x: nodeSize.width * 0.5,
|
||||||
y: 0,
|
y: 0,
|
||||||
width: 1,
|
|
||||||
height: 1,
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -170,9 +170,9 @@
|
|||||||
style:z-index={zIndex}
|
style:z-index={zIndex}
|
||||||
style:transform="translate({positionOriginX}px, {positionOriginY}px)"
|
style:transform="translate({positionOriginX}px, {positionOriginY}px)"
|
||||||
style:visibility={initialized ? 'visible' : 'hidden'}
|
style:visibility={initialized ? 'visible' : 'hidden'}
|
||||||
style:width={width === undefined ? undefined : `${width}px`}
|
style="{style ?? ''}; {!width ? '' : `width:${width}px;`} {!height
|
||||||
style:height={height === undefined ? undefined : `${height}px`}
|
? ''
|
||||||
{style}
|
: `height:${height}px;`}"
|
||||||
on:click={onSelectNodeHandler}
|
on:click={onSelectNodeHandler}
|
||||||
on:mouseenter={(event) => dispatch('nodemouseenter', { node, event })}
|
on:mouseenter={(event) => dispatch('nodemouseenter', { node, event })}
|
||||||
on:mouseleave={(event) => dispatch('nodemouseleave', { node, event })}
|
on:mouseleave={(event) => dispatch('nodemouseleave', { node, event })}
|
||||||
|
|||||||
Reference in New Issue
Block a user