Skip to content

Commit

Permalink
document opacity fill in changes, typo fixes, fix some alpha ->
Browse files Browse the repository at this point in the history
opacity I missed
  • Loading branch information
Tony Cook committed Nov 10, 2009
1 parent 35a1560 commit a16bae7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
3 changes: 3 additions & 0 deletions Changes
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions lib/Imager/Fill.pm
Expand Up @@ -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 &&
Expand All @@ -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;
}
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions t/t20fill.t
Expand Up @@ -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
Expand Down

0 comments on commit a16bae7

Please sign in to comment.