Focus frames beneath a node on dblclick (#1)
This commit is contained in:
@@ -399,6 +399,17 @@ export class FlamechartPanZoomView extends ReloadableComponent<FlamechartPanZoom
|
||||
}
|
||||
}
|
||||
|
||||
private onDblClick = (ev: MouseEvent) => {
|
||||
if (this.hoveredLabel) {
|
||||
const hoveredBounds = this.hoveredLabel.configSpaceBounds
|
||||
const viewportRect = new Rect(
|
||||
hoveredBounds.origin.minus(new Vec2(0, 1)),
|
||||
hoveredBounds.size.withY(this.props.configSpaceViewportRect.height())
|
||||
)
|
||||
this.props.setConfigSpaceViewportRect(viewportRect)
|
||||
}
|
||||
}
|
||||
|
||||
private updateCursor() {
|
||||
if (this.lastDragPos) {
|
||||
document.body.style.cursor = 'grabbing'
|
||||
@@ -544,6 +555,7 @@ export class FlamechartPanZoomView extends ReloadableComponent<FlamechartPanZoom
|
||||
onMouseDown={this.onMouseDown}
|
||||
onMouseMove={this.onMouseMove}
|
||||
onMouseLeave={this.onMouseLeave}
|
||||
onDblClick={this.onDblClick}
|
||||
onWheel={this.onWheel}
|
||||
ref={this.containerRef}>
|
||||
<canvas
|
||||
@@ -708,4 +720,4 @@ export class FlamechartView extends ReloadableComponent<FlamechartViewProps, Fla
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user