projects
/
sdlgit/SDL_perl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(parent:
64c66a0
)
implemented normalize
Breno G. de Oliveira [Sun, 4 Oct 2009 07:11:41 +0000 (
04:11
-0300)]
lib/SDL/Game/Rect.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/SDL/Game/Rect.pm
b/lib/SDL/Game/Rect.pm
index
18f4067
..
01368f0
100644
(file)
--- a/
lib/SDL/Game/Rect.pm
+++ b/
lib/SDL/Game/Rect.pm
@@
-557,6
+557,21
@@
sub fit_ip {
return;
}
+sub normalize {
+ my $self = shift;
+
+ if ($self->w < 0) {
+ $self->x($self->x + $self->w);
+ $self->w(-$self->w);
+ }
+
+ if ($self->h < 0) {
+ $self->y( $self->y + $self->h);
+ $self->h(-$self->h);
+ }
+ return;
+}
+
42;
__END__