Skip to content

Commit

Permalink
fixes accounting for labels in bb and improves compound support re. u…
Browse files Browse the repository at this point in the history
…pdateCompoundBounds() #1194 #1196
  • Loading branch information
maxkfranz committed Dec 15, 2015
1 parent 6793546 commit 7816705
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
10 changes: 4 additions & 6 deletions src/collection/dimensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -544,14 +544,12 @@ var boundingBoxImpl = function( ele, options ){
//////////////////////////

if( styleEnabled && options.includeLabels ){

updateBounds( getLabelBounds( ele ) );
updateBoundsFromBox( bounds, getLabelBounds( ele ) );

if( isEdge ){
updateBounds( getLabelBounds( ele, 'source' ) );
updateBounds( getLabelBounds( ele, 'target' ) );
updateBoundsFromBox( bounds, getLabelBounds( ele, 'source' ) );
updateBoundsFromBox( bounds, getLabelBounds( ele, 'target' ) );
}

} // style enabled for labels
} // if displayed

Expand Down Expand Up @@ -594,7 +592,7 @@ elesfn.boundingBox = function( options ){
var cy_p = eles.cy()._private;
var styleEnabled = cy_p.styleEnabled;
if( styleEnabled ){
cy_p.renderer.recalculateRenderedStyle( eles.union( eles.parallelEdges() ) );
cy_p.renderer.recalculateRenderedStyle( eles.union( eles.parallelEdges() ), !opts.useCache );
}

for( var i = 0; i < eles.length; i++ ){
Expand Down
4 changes: 2 additions & 2 deletions src/extensions/renderer/base/coord-ele-math.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ BRp.registerCalculationListeners = function(){
this.beforeRender( updateEles );
};

BRp.recalculateRenderedStyle = function( eles ){
BRp.recalculateRenderedStyle = function( eles, bypassCache ){
var edges = [];
var nodes = [];

Expand All @@ -72,7 +72,7 @@ BRp.recalculateRenderedStyle = function( eles ){
var id = _p.data.id;

// only update if dirty
if( rstyle.clean ){ continue; }
if( !bypassCache && rstyle.clean ){ continue; }

if( _p.group === 'nodes' ){
var pos = _p.position;
Expand Down

0 comments on commit 7816705

Please sign in to comment.