Skip to content

Commit

Permalink
Merge pull request #151 from ditrit/bugfix/icon_size_linkable_button
Browse files Browse the repository at this point in the history
Bugfix: Fix the size of icons in linkable-button
  • Loading branch information
Zorin95670 authored Feb 9, 2023
2 parents c5204b9 + b9838e4 commit ccd975a
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 ccd975a

Please sign in to comment.