flamegraph

Fork of flamegraph without J***S*****.
git clone git://git.laack.co/flamegraph.git
Log | Files | Refs | README

commit e21bdc5cbfcb8d67f0992ab20fa1f14e3408d04d
parent 38a84db2af5271ad71627214643216f0aa86361c
Author: Brendan Gregg <brendan.d.gregg@gmail.com>
Date:   Tue, 28 Oct 2014 13:31:24 -0700

an awful hack for awful JavaScript float issues. fix later.

Diffstat:
Mflamegraph.pl | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/flamegraph.pl b/flamegraph.pl @@ -531,6 +531,9 @@ my $inc = <<INC; var ymin = parseFloat(attr["y"].value); var ratio = (svg.width.baseVal.value - 2*$xpad) / width; + // Workaround for JavaScript float issues (fix me) + var fudge = 0.0001; + var unzoombtn = document.getElementById("unzoom"); unzoombtn.style["opacity"] = "1.0"; @@ -543,7 +546,7 @@ my $inc = <<INC; // Is it an ancestor if (parseFloat(a["y"].value) > ymin) { // Direct ancestor - if (ex <= xmin && (ex+ew) >= xmax) { + if (ex <= xmin && (ex+ew+fudge) >= xmax) { e.style["opacity"] = "0.5"; zoom_parent(e); e.onclick = function(e){unzoom(); zoom(this);}; @@ -556,7 +559,7 @@ my $inc = <<INC; // Children maybe else { // no common path - if (ex < xmin || ex >= xmax) { + if (ex < xmin || ex + fudge >= xmax) { e.style["display"] = "none"; } else {