From a16bae723a54f702dd1147311ea6dbb71c343f2c Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Tue, 10 Nov 2009 12:07:44 +0000 Subject: [PATCH] document opacity fill in changes, typo fixes, fix some alpha -> opacity I missed --- Changes | 3 +++ lib/Imager/Fill.pm | 9 +++++---- t/t20fill.t | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Changes b/Changes index 6f320737..07a464bf 100644 --- a/Changes +++ b/Changes @@ -3,6 +3,9 @@ Imager release history. Older releases can be found in Changes.old Imager 0.71 - unreleased =========== + - add the opacity fill type - an adaptor that modifies the opacity of + another fill. + Bug fixes: - the conv filter now enforces that the sum of the coefficients is diff --git a/lib/Imager/Fill.pm b/lib/Imager/Fill.pm index aca9c56d..34786ead 100644 --- a/lib/Imager/Fill.pm +++ b/lib/Imager/Fill.pm @@ -128,7 +128,7 @@ sub new { elsif (defined $hsh{type} && $hsh{type} eq "opacity") { my $other_fill = delete $hsh{other}; unless (defined $other_fill) { - Imager->_set_error("'other' parameter required to create alpha fill"); + Imager->_set_error("'other' parameter required to create opacity fill"); return; } unless (ref $other_fill && @@ -142,7 +142,7 @@ sub new { undef $other_fill; } unless ($other_fill) { - Imager->_set_error("'other' parameter must be an Imager::Fill object to create an alpha fill"); + Imager->_set_error("'other' parameter must be an Imager::Fill object to create an opacity fill"); return; } } @@ -187,7 +187,8 @@ sub combines { dx=>$dx, dy=>$dy); my $fill3 = Imager::Fill->new(fountain=>$type, ...); my $fill4 = Imager::Fill->new(image=>$img, ...); - my $fill5 = Imager::Fill->new(type => "alpha", other => $fill, alpha => ...); + my $fill5 = Imager::Fill->new(type => "opacity", other => $fill, + opacity => ...); =head1 DESCRIPTION @@ -376,7 +377,7 @@ The matrix parameter will significantly slow down the fill. my $fill = Imager::Fill->new(type => "opacity", other => $fill, opacity => 0.25); -This can be used to make a fill that is a more translucent of opaque +This can be used to make a fill that is a more translucent or opaque version of an existing fill. This is intended for use where you receive a fill object as a parameter and need to change the opacity. diff --git a/t/t20fill.t b/t/t20fill.t index 0eee844f..8e2bb21f 100644 --- a/t/t20fill.t +++ b/t/t20fill.t @@ -568,11 +568,11 @@ SKIP: } ok(!Imager::Fill->new(type => "opacity"), "should fail to make an opacity fill with no other fill object"); - is(Imager->errstr, "'other' parameter required to create alpha fill", + is(Imager->errstr, "'other' parameter required to create opacity fill", "check error message"); ok(!Imager::Fill->new(type => "opacity", other => "xx"), "should fail to make an opacity fill with a bad other parameter"); - is(Imager->errstr, "'other' parameter must be an Imager::Fill object to create an alpha fill", + is(Imager->errstr, "'other' parameter must be an Imager::Fill object to create an opacity fill", "check error message"); # check auto conversion of hashes