Skip to content

Commit

Permalink
Cached intersections should take into account bundle reversing in the…
Browse files Browse the repository at this point in the history
… pair edge set #1942
  • Loading branch information
maxkfranz committed Aug 23, 2017
1 parent 4f54bb2 commit 54d9a0b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/extensions/renderer/base/coord-ele-math/edge-control-points.js
Expand Up @@ -143,6 +143,9 @@ BRp.findEdgeControlPoints = function( edges ){

var edgeIsUnbundled = curveStyle === 'unbundled-bezier' || curveStyle === 'segments';

// whether the normalised pair order is the reverse of the edge's src-tgt order
var edgeIsSwapped = src.id() !== edge.source().id();

var ctrlptDists = edge.pstyle( 'control-point-distances' );
var loopDir = edge.pstyle('loop-direction').pfValue;
var loopSwp = edge.pstyle('loop-sweep').pfValue;
Expand Down Expand Up @@ -350,8 +353,13 @@ BRp.findEdgeControlPoints = function( edges ){

}

rs.srcIntn = pairEdges.srcIntn;
rs.tgtIntn = pairEdges.tgtIntn;
if( !edgeIsSwapped ){
rs.srcIntn = pairEdges.srcIntn;
rs.tgtIntn = pairEdges.tgtIntn;
} else { // ensure that the per-edge cached value for intersections are correct for swapped bundled edges
rs.srcIntn = pairEdges.tgtIntn;
rs.tgtIntn = pairEdges.srcIntn;
}

if( src === tgt ){
// Self-edge
Expand Down

0 comments on commit 54d9a0b

Please sign in to comment.