NodeGraph: Fix subTitle and secondaryStat being truncated in some cases (#40244)

This commit is contained in:
fengjb 2021-11-07 14:13:14 +08:00 committed by GitHub
parent fe43b30adf
commit e9d90231e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -87,7 +87,7 @@ export const Node = memo(function Node(props: {
{hovering && <circle className={styles.hoverCircle} r={nodeR - 3} cx={node.x} cy={node.y} strokeWidth={2} />}
<ColorCircle node={node} />
<g className={styles.text}>
<foreignObject x={node.x - (hovering ? 100 : 35)} y={node.y - 15} width={hovering ? '200' : '70'} height="30">
<foreignObject x={node.x - (hovering ? 100 : 35)} y={node.y - 15} width={hovering ? '200' : '70'} height="40">
<div className={cx(styles.statsText, hovering && styles.textHovering)}>
<span>{node.mainStat && statToString(node.mainStat, node.dataFrameRowIndex)}</span>
<br />
@ -98,7 +98,7 @@ export const Node = memo(function Node(props: {
x={node.x - (hovering ? 100 : 50)}
y={node.y + nodeR + 5}
width={hovering ? '200' : '100'}
height="30"
height="40"
>
<div className={cx(styles.titleText, hovering && styles.textHovering)}>
<span>{node.title}</span>