Skip to content

Commit

Permalink
No specialized multi-step bezier
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Sep 11, 2024
1 parent dc88a7b commit abce472
Showing 1 changed file with 19 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,60 +128,29 @@ const AlignmentConnections = observer(function ({
yPos(trackId, level2, views, tracks, c2, getTrackYPosOverride) -
yOffset
const sameLevel = level1 === level2
const trackHeight =
sameLevel && isAbnormal ? tracks[level1].displays[0].height / 2 : 0
const trackHeight = sameLevel && isAbnormal ? 100 : 0
const pf1 = hasPaired ? -1 : 1

// possible todo: use totalCurveHeight to possibly make alternative
// squiggle if the S is too small
const path = isAbnormal
? [
'M',
x1,
y1,
'C',

// first bezier x,y
x1 + 100 * f1.get('strand') * rf1,
y1,

// second bezier x,y
x1 + 100 * f1.get('strand') * rf1,
y1 + 100,

// third bezier x,y
x2 - 100 * f2.get('strand') * rf2 * pf1,
y2 + 100,

// bezier continuation
'S',

// first bezier x,y
x2 - 100 * f2.get('strand') * rf2 * pf1,
y2 + 100,

// second bezier x,y
x2,
y2,
].join(' ')
: [
'M',
x1,
y1,
'C',

// first bezier x,y
x1 + 200 * f1.get('strand') * rf1,
y1,

// second bezier x,y
x2 - 200 * f2.get('strand') * rf2 * pf1,
y2,

// third bezier x,y
x2,
y2,
].join(' ')
const path = [
'M',
x1,
y1,
'C',

// first bezier x,y
x1 + 200 * f1.get('strand') * rf1,
y1 + trackHeight,

// second bezier x,y
x2 - 200 * f2.get('strand') * rf2 * pf1,
y2 + trackHeight,

// third bezier x,y
x2,
y2,
].join(' ')
const id = `${f1.id()}-${f2.id()}`
ret.push(
<path
Expand Down

0 comments on commit abce472

Please sign in to comment.