{#key refresh} {#each $fightConnector.showedConnections as connection} {@const fromLeft = connection.fromElement.offsetLeft + connection.fromElement.offsetWidth} {@const toLeft = connection.toElement.offsetLeft} {@const fromTop = connection.fromElement.offsetTop + connection.fromElement.offsetHeight / 2} {@const toTop = connection.toElement.offsetTop + connection.toElement.offsetHeight / 2} {@const horizontalDistance = toLeft - fromLeft} {@const verticalDistance = toTop - fromTop} {@const midLeft = fromLeft + horizontalDistance / 2 + connection.offset} {@const firstSegmentWidth = horizontalDistance / 2} {@const secondSegmentWidth = horizontalDistance / 2}
{/each} {/key}