summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/App/VRR/Fakedisplay.pm.PL17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/App/VRR/Fakedisplay.pm.PL b/lib/App/VRR/Fakedisplay.pm.PL
index d051f2c..7969bde 100644
--- a/lib/App/VRR/Fakedisplay.pm.PL
+++ b/lib/App/VRR/Fakedisplay.pm.PL
@@ -169,6 +169,23 @@ sub new_line {
return;
}
+sub crop_to_content {
+ my ($self) = @_;
+
+ my $new_im = GD::Image->new($self->{width} * $self->{scale},
+ $self->{offset_y} * $self->{scale}, 1);
+ $new_im->copyResized($self->{image}, 0, 0, 0, 0,
+ $self->{width} * $self->{scale},
+ $self->{offset_y} * $self->{scale},
+ $self->{width} * $self->{scale},
+ $self->{offset_y} * $self->{scale}
+ );
+
+ $self->{image} = $new_im;
+
+ return;
+}
+
sub png {
my ($self) = @_;