From d9f1c5de2e5d38315f020837058ee3d351d35b20 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Mon, 19 Feb 2007 00:06:29 -0800 Subject: [PATCH] add suport for width/height to version.cgi --- cgi/version.cgi | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/cgi/version.cgi b/cgi/version.cgi index 338075f..c1df691 100755 --- a/cgi/version.cgi +++ b/cgi/version.cgi @@ -34,12 +34,14 @@ my %img_types = (svg => 'image/svg+xml', my $q = new CGI::Simple; my %cgi_var = cgi_parameters(query => $q, - single => [qw(package format ignore_boring)], + single => [qw(package format ignore_boring width height)], default => {package => 'xterm', found => [], fixed => [], ignore_boring => 1, format => 'png', + width => undef, + height => undef, }, ); @@ -54,6 +56,16 @@ for my $dist (@{$config{distributions}}) { push @{$version_to_dist{$version}}, $dist; } } + +if (defined $cgi_var{width}) { + $cgi_var{width} =~ /(\d+)/; + $cgi_var{width} = $1; +} +if (defined $cgi_var{height}) { + $cgi_var{height} =~ /(\d+)/; + $cgi_var{height} = $1; +} + # then figure out which are affected. # turn found and fixed into full versions @{$cgi_var{found}} = makesourceversions($cgi_var{package},undef,@{$cgi_var{found}}); @@ -96,6 +108,9 @@ for my $found_fixed (qw(found fixed)) { my %all_states = $version->allstates($cgi_var{found},$cgi_var{fixed}); my $dot = "digraph G {\n"; +if (defined $cgi_var{width} and defined $cgi_var{height}) { + $dot .= qq(size="$cgi_var{width},$cgi_var{height}";\n); +} my %state = (found => ['fillcolor="salmon"', 'style="filled"', 'shape="diamond"', -- 2.39.2