commit a8d807a11c0f22871134324bda709618ca482b58
parent 8f2e64ec05324e3ba5e10082eaf134bc2188972a
Author: Brendan Gregg <brendan.d.gregg@gmail.com>
Date: Fri, 18 Aug 2017 14:05:38 -0700
fix #125
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/flamegraph.pl b/flamegraph.pl
@@ -182,9 +182,9 @@ GetOptions(
$help && usage();
# internals
-my $ypad1 = $fontsize * 4; # pad top, include title
+my $ypad1 = $fontsize * 3; # pad top, include title
my $ypad2 = $fontsize * 2 + 10; # pad bottom, include labels
-my $ypad3 = $fontsize * 2 + 1; # pad top, include subtitle (optional)
+my $ypad3 = $fontsize * 2; # pad top, include subtitle (optional)
my $xpad = 10; # pad lefm and right
my $framepad = 1; # vertical padding for frames
my $depthmax = 0;
@@ -678,7 +678,7 @@ while (my ($id, $node) = each %Node) {
}
# draw canvas, and embed interactive JavaScript program
-my $imageheight = ($depthmax * $frameheight) + $ypad1 + $ypad2;
+my $imageheight = (($depthmax + 1) * $frameheight) + $ypad1 + $ypad2;
$imageheight += $ypad3 if $subtitletext ne "";
my $im = SVG->new();
$im->header($imagewidth, $imageheight);