commit b5893271a90d49cf3f54dc98062201da3510f78a
parent 29ef172bfc76baf4a1209a325228b4de902480be
Author: Brendan Gregg <brendan.d.gregg@gmail.com>
Date: Mon, 20 Oct 2014 12:22:13 -0700
show zoom button when needed, and at top
Diffstat:
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/flamegraph.pl b/flamegraph.pl
@@ -512,6 +512,9 @@ my $inc = <<INC;
var ymin = parseFloat(attr["y"].value);
var ratio = (svg.width.baseVal.value - 2*$xpad) / width;
+ var unzoombtn = document.getElementById("unzoom");
+ unzoombtn.style["fill-opacity"] = "1.0";
+
var el = document.getElementsByTagName("g");
for(var i=0;i<el.length;i++){
var e = el[i];
@@ -546,6 +549,9 @@ my $inc = <<INC;
}
}
function unzoom() {
+ var unzoombtn = document.getElementById("unzoom");
+ unzoombtn.style["fill-opacity"] = "0.0";
+
var el = document.getElementsByTagName("g");
for(i=0;i<el.length;i++) {
el[i].style["display"] = "block";
@@ -567,7 +573,7 @@ my ($white, $black, $vvdgrey, $vdgrey) = (
);
$im->stringTTF($black, $fonttype, $fontsize + 5, 0.0, int($imagewidth / 2), $fontsize * 2, $titletext, "middle");
$im->stringTTF($black, $fonttype, $fontsize, 0.0, $xpad, $imageheight - ($ypad2 / 2), " ", "", 'id="details"');
-$im->stringTTF($black, $fonttype, $fontsize, 0.0, $xpad, $imageheight, "Reset Zoom", "", 'id="unzoom" onclick="unzoom()"');
+$im->stringTTF($black, $fonttype, $fontsize, 0.0, $xpad, $fontsize * 2, "Reset Zoom", "", 'id="unzoom" onclick="unzoom()" style="fill-opacity:0.0"');
if ($palette) {
read_palette();