summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2013-08-28 19:28:01 +0200
committerDaniel Friesel <derf@finalrewind.org>2013-08-28 19:28:01 +0200
commit3ac2092193f48c76dbd3b49a98474346e1a4c690 (patch)
tree0ca2506a804029efc4c36b943c5dd314992381f7
parenta9af55a5e060807411b28aba1909b6375cad5928 (diff)
add scale option
-rw-r--r--cgi/index.pl8
-rw-r--r--lib/App/VRR/Fakedisplay.pm.PL2
2 files changed, 8 insertions, 2 deletions
diff --git a/cgi/index.pl b/cgi/index.pl
index 0667351..9141781 100644
--- a/cgi/index.pl
+++ b/cgi/index.pl
@@ -150,6 +150,11 @@ sub render_image {
my $color = $self->param('color') || '255,208,0';
my $no_lines = $self->param('no_lines');
my $backend = $self->param('backend');
+ my $scale = $self->param('scale');
+
+ if ($scale > 30) {
+ $scale = 30;
+ }
my ( @grep_line, @grep_platform );
my $offset = 0;
@@ -188,7 +193,8 @@ sub render_image {
my $png = App::VRR::Fakedisplay->new(
width => 180,
height => $no_lines * 10,
- color => [ split( qr{,}, $color ) ]
+ color => [ split( qr{,}, $color ) ],
+ scale => $scale,
);
if ($errstr) {
diff --git a/lib/App/VRR/Fakedisplay.pm.PL b/lib/App/VRR/Fakedisplay.pm.PL
index 13a97cf..d051f2c 100644
--- a/lib/App/VRR/Fakedisplay.pm.PL
+++ b/lib/App/VRR/Fakedisplay.pm.PL
@@ -90,7 +90,7 @@ sub new {
my $self = {
width => $opt{width} || 140,
height => $opt{height} || 40,
- scale => 10,
+ scale => $opt{scale} || 10,
offset_x => 0,
offset_y => 0,
};