feat: add tagged red thread connections
This commit is contained in:
@@ -11,12 +11,27 @@ import {
|
||||
normalizeCase,
|
||||
panViewport,
|
||||
relationPosition,
|
||||
threadCurve,
|
||||
timelinePositionPercent,
|
||||
timelineRange,
|
||||
zoomFromWheel,
|
||||
zoomFromPinch,
|
||||
} from './boardDomain'
|
||||
|
||||
describe('red thread geometry', () => {
|
||||
it('turns tightness into a taut or visibly sagging bezier curve', () => {
|
||||
const taut = threadCurve({ x: 0, y: 0 }, { x: 120, y: 60 }, 100)
|
||||
const slack = threadCurve({ x: 0, y: 0 }, { x: 120, y: 60 }, 0)
|
||||
expect(taut.midpoint).toEqual({ x: 60, y: 30 })
|
||||
expect(slack.midpoint.y).toBeGreaterThan(taut.midpoint.y)
|
||||
expect(slack.path).toMatch(/^M 0 0 C /)
|
||||
})
|
||||
|
||||
it('clamps tightness to its normalized percentage range', () => {
|
||||
expect(threadCurve({ x: 0, y: 0 }, { x: 100, y: 0 }, 200)).toEqual(threadCurve({ x: 0, y: 0 }, { x: 100, y: 0 }, 100))
|
||||
})
|
||||
})
|
||||
|
||||
const folder: Evidence = {
|
||||
id: 'folder-1',
|
||||
type: 'folder',
|
||||
|
||||
Reference in New Issue
Block a user