Skip to content

Commit

Permalink
fix(dia.LinkView): Paper sometimes autosizes incorrectly after moving…
Browse files Browse the repository at this point in the history
… links with doubleLinkTools option (#2330)

Moving around elements and links that have doubleLinkTools: true but link length is short enough
for the secondary tool to be hidden, the tool position is not updated, causing miscalculations in paper size and paddings.

Fix by using display instead of visibility, to take the tool out of the rendering tree when invisible.
  • Loading branch information
coyoteecd authored Sep 8, 2023
1 parent 47a0fbb commit d9696c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dia/LinkView.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1117,11 +1117,11 @@ export const LinkView = CellView.extend({

toolPosition = this.getPointAtLength(connectionLength - doubleLinkToolsOffset);
this._tool2Cache.attr('transform', 'translate(' + toolPosition.x + ', ' + toolPosition.y + ') ' + scale);
this._tool2Cache.attr('visibility', 'visible');
this._tool2Cache.attr('display', 'inline');

} else if (this.options.doubleLinkTools) {

this._tool2Cache.attr('visibility', 'hidden');
this._tool2Cache.attr('display', 'none');
}
}

Expand Down

0 comments on commit d9696c3

Please sign in to comment.