mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 18:20:27 +00:00
Fixes flickering when mouse moves between nodes labels
w/ a secret rect!
This commit is contained in:
@@ -92,6 +92,12 @@ export default class Node extends React.Component {
|
||||
return (
|
||||
<g className={className} transform={transform} onClick={this.handleMouseClick}
|
||||
onMouseEnter={this.handleMouseEnter} onMouseLeave={this.handleMouseLeave}>
|
||||
<rect className="hover-box"
|
||||
x={-nodeScale(scaleFactor * 0.5)}
|
||||
y={-nodeScale(scaleFactor * 0.5)}
|
||||
width={nodeScale(scaleFactor)}
|
||||
height={nodeScale(scaleFactor) + subLabelOffsetY}
|
||||
/>
|
||||
<text className="node-label" textAnchor="middle" style={{fontSize: labelFontSize}}
|
||||
x="0" y={labelOffsetY + nodeScale(0.5 * scaleFactor)}>
|
||||
{labelText}
|
||||
|
||||
@@ -338,6 +338,10 @@ h2 {
|
||||
cursor: pointer;
|
||||
transition: opacity .5s @base-ease;
|
||||
|
||||
.hover-box {
|
||||
fill-opacity: 0;
|
||||
}
|
||||
|
||||
&.hovered text {
|
||||
stroke: @background-average-color;
|
||||
stroke-width: 8px;
|
||||
|
||||
Reference in New Issue
Block a user