Skip to content

Commit 3132d0d

Browse files
[ui] Fix tooltip getting clipped at the bottom of the screen
1 parent 515d96d commit 3132d0d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

res/flamegraph-rendering/script.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -682,11 +682,11 @@ function canvasOnMouseMove(e) {
682682
tooltip_x = cursor_x - tooltip_w;
683683
}
684684

685-
if (cursor_y + tooltip_h + 20 > canvas.clientHeight) {
685+
if (e.clientY + tooltip_h + 20 > window.innerHeight - statusBox.clientHeight) {
686686
tooltip_y = cursor_y - tooltip_h;
687687
}
688688

689-
console.log("cursor_x", cursor_x, "clientWidth", canvas.clientWidth, "tooltip_w", tooltip_w, "tooltip_h", tooltip_h, "tooltip_x", tooltip_x);
689+
// console.log("e.clientY", e.clientY, "cursor_y", cursor_y, "window.innerHeight", window.innerHeight, "tooltip_h", tooltip_h, "tooltip_y", tooltip_y);
690690

691691
tooltip.style.left = tooltip_x;
692692
tooltip.style.top = tooltip_y;

res/flamegraph-rendering/template.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#tooltip .statdiv {display:flex; justify-content:space-around;}
1818
#tooltipRightClickHint {font-size:9px; width:100%; display:flex; justify-content:center;}
1919
@keyframes fadeIn { 99% { visibility:hidden; } 100% { visibility:visible; }}
20-
.statusBox {background-color:#ffffe6; position:fixed; left:0; bottom:0; width:100%;
20+
#statusBox {background-color:#ffffe6; position:fixed; left:0; bottom:0; width:100%;
2121
box-sizing: border-box; padding:5px 1em; display:inline-flex;
2222
justify-content:space-between;}
2323
#hoverTip {overflow: hidden; white-space: nowrap}
@@ -117,7 +117,7 @@
117117
</div>
118118
<div id="tooltipRightClickHint"><span><i>Right click for options</i></span></div>
119119
</div>
120-
<div class='statusBox'>
120+
<div id='statusBox'>
121121
<span id="spinner"></span>
122122
<span id='hoverTip'></span>
123123
<span id='matchContainer'>Matched: <span id='matchedLabel'></span></span>

0 commit comments

Comments
 (0)