Make the photos retain their aspect ratios.
authorAndrew Ruthven <andrew@etc.gen.nz>
Fri, 26 Sep 2008 10:12:14 +0000 (22:12 +1200)
committerAndrew Ruthven <andrew@etc.gen.nz>
Fri, 26 Sep 2008 10:12:14 +0000 (22:12 +1200)
Thank you to Emmanuele Bassi for all his help on IRC!

lib/Display/Plugins/FSpot.pm

index b191d46..6bcff21 100644 (file)
@@ -36,8 +36,10 @@ sub display_photo {
   
   #warn "Loading $file\n";
   $self->{'new'}->set_opacity(0);
+  $self->{'new'}->set_size(-1, -1);
   $self->{'new'}->set_from_file($file);
   $self->{'new'}->set_opacity(0);
+  $self->{'new'}->set_height($self->{'stage'}->get_height());
   #$self->{'stage'}->add($self->{'new'});
 
 #warn "Going to show $file\n";
@@ -124,7 +126,7 @@ LIMIT 1
 
   for my $age ('new', 'old') {
     $self->{$age} = Clutter::Texture->new();
-    $self->{$age}->set_size($self->{'stage'}->get_size());
+    $self->{$age}->set('request_mode' => 'width-for-height');
     $self->{$age}->set('keep-aspect-ratio' => 1);
     $self->{$age}->set('sync-size' => 1);
     $self->{$age}->set_opacity(0);