Skip to content

Commit

Permalink
Fix the size of icons in linkable-button
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitriChauvel committed Feb 9, 2023
1 parent c5204b9 commit b9838e4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/draw/DefaultDrawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1334,7 +1334,14 @@ class DefaultDrawer {
.attr('y', buttonPadding)
.attr('width', iconSize)
.attr('height', iconSize)
.attr('viewBox', '0 0 32 32')
// eslint-disable-next-line prefer-arrow-callback
.attr('viewBox', function setViewbox() {
const icon = d3.select(this).select('svg');
const width = icon.attr('width').replace('px', '');
const height = icon.attr('height').replace('px', '');

return `0 0 ${width} ${height}`;
})
.attr('background-color', 'white');

buttons
Expand Down

0 comments on commit b9838e4

Please sign in to comment.