diff --git a/PerlRPG/Assets.pm b/PerlRPG/Assets.pm index 7dfb793..34e7c2b 100644 --- a/PerlRPG/Assets.pm +++ b/PerlRPG/Assets.pm @@ -208,12 +208,14 @@ sub LoadAnimatedSprite { ); my $surface = $s1->surface(); + my $smallest = ($surface->width() < $surface->height() ? $surface->width() : $surface->height()); + my $sprite = SDLx::Sprite::Animated->new( surface => $surface, - width => $surface->width(), - height => $surface->width(), - step_x => $surface->width(), - step_y => $surface->width(), + width => $smallest, + height => $smallest, + step_x => $smallest, + step_y => $smallest, ); if(!$sprite) { LogData(ERROR, "Unable to load ASprite '$filename': $!");