# HG changeset patch # User Drew Perttula # Date 1465731325 0 # Node ID b291b7be73323f18fee4e05ecc3a457cd3b15122 # Parent 2ed61945d881b48eacb9578dcb9fba7c08052880 refactor. try to remove connector turds (failed) Ignore-this: 5341ffd154c24e4c62f3d58bdc595b7 diff -r 2ed61945d881 -r b291b7be7332 light9/web/timeline/timeline.coffee --- a/light9/web/timeline/timeline.coffee Sun Jun 12 11:25:27 2016 +0000 +++ b/light9/web/timeline/timeline.coffee Sun Jun 12 11:35:25 2016 +0000 @@ -15,6 +15,7 @@ childByUri[e.uri] = e for uri in _.difference(childUris, newUris) + childByUri[uri].detached() childByUri[uri].remove() for uri in _.difference(newUris, childUris) parent.appendChild(makeChild(uri)) @@ -433,14 +434,20 @@ if screenPts[3].e(1) - screenPts[0].e(1) < 100 @clearAdjusters() + # also kill their connectors return + @makeCurveAdjusters(curveWidth, yForV, worldPts) + + makeCurveAdjusters: (curveWidth, yForV, worldPts) -> + U = (x) -> @graph.Uri(x) + @adjusterIds[@uri+'/offset'] = true @setAdjuster(@uri+'/offset', => new AdjustableFloatObject({ graph: @graph subj: @uri - pred: @graph.Uri(':originTime') - ctx: @graph.Uri(@song) + pred: U(':originTime') + ctx: U(@song) getDisplayValue: (v, dv) => "o=#{dv}" getTargetPosForValue: (value) => # display bug: should be working from pt[0].t, not from origin @@ -457,8 +464,8 @@ adj = new AdjustableFloatObject({ graph: @graph subj: worldPts[pointNum].uri - pred: @graph.Uri(':time') - ctx: @graph.Uri(@song) + pred: U(':time') + ctx: U(@song) getTargetPosForValue: (value) => $V([@zoomInX(value), yForV(worldPts[pointNum].e(2))])