Skip to content

Commit c3cdffc

Browse files
authored
Calc proper value for node strokeWith when applying pan&zoom (#17)
1 parent c5bddcc commit c3cdffc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/Graph/helper.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ function _buildNodeProps(node, config, nodeCallbacks, someNodeHighlighted, trans
140140
const t = 1 / transform;
141141
const nodeSize = node.size || config.node.size;
142142
const fontSize = node.highlighted ? config.node.highlightFontSize : config.node.fontSize;
143-
// label offset in order to the font and node size
144143
const dx = (fontSize * t) + (nodeSize / 100) + 1.5;
144+
const strokeWidth = node.highlighted ? config.node.highlightStrokeWidth : config.node.strokeWidth;
145145

146146
return {
147147
className: CONST.NODE_CLASS_NAME,
@@ -161,7 +161,7 @@ function _buildNodeProps(node, config, nodeCallbacks, someNodeHighlighted, trans
161161
renderLabel: config.node.renderLabel,
162162
size: nodeSize * t,
163163
stroke,
164-
strokeWidth: node.highlighted ? config.node.highlightStrokeWidth : config.node.strokeWidth,
164+
strokeWidth: strokeWidth * t,
165165
type: node.type || config.node.symbolType
166166
};
167167
}

0 commit comments

Comments
 (0)