import { ISettings, IState } from '../interfaces'; import { line } from 'mz-canvas'; import { v2Distance } from 'mz-math'; import { rgbaToString } from './colors-provider'; import { getConnectionSizePerViewport } from './viewport-provider'; /** * Draw connection between the shapes. */ export const drawConnections = (options: ISettings, state: IState) => { const { particles, ctx, connectionRgbColor } = state; const rect = options.$placeholder?.getBoundingClientRect(); const placeholderWidth = rect?.width || 0; const maxConnectionSize = getConnectionSizePerViewport(options, placeholderWidth); for(let i= 0; i