← Back to team overview

ayatana-commits team mailing list archive

[Merge] lp:~bratsche/xsplash/remove-scaling into lp:xsplash

 

Cody Russell has proposed merging lp:~bratsche/xsplash/remove-scaling into lp:xsplash.

Requested reviews:
    Canonical Desktop Experience Team (canonical-dx-team)
-- 
https://code.launchpad.net/~bratsche/xsplash/remove-scaling/+merge/11997
Your team ayatana-commits is subscribed to branch lp:xsplash.
=== modified file 'src/xsplash.c'
--- src/xsplash.c	2009-09-17 03:23:42 +0000
+++ src/xsplash.c	2009-09-17 18:31:20 +0000
@@ -295,24 +295,6 @@
   }
 }
 
-static GdkPixbuf *
-scale_to_min (GdkPixbuf *src, gint min_width, gint min_height)
-{
-  double factor;
-  int src_width, src_height;
-  int new_width, new_height;
-
-  src_width = gdk_pixbuf_get_width (src);
-  src_height = gdk_pixbuf_get_height (src);
-
-  factor = MAX (min_width / (double)src_width, min_height / (double)src_height);
-
-  new_width = floor (src_width * factor + 0.5);
-  new_height = floor (src_height * factor + 0.5);
-
-  return gdk_pixbuf_scale_simple (src, new_width, new_height, GDK_INTERP_BILINEAR);
-}
-
 static gchar *
 get_background_filename (void)
 {
@@ -425,23 +407,19 @@
 get_pixbuf (gint width, gint height)
 {
   GdkPixbuf *pixbuf;
-  GdkPixbuf *scaled;
   gint x, y, w, h;
 
   pixbuf = gdk_pixbuf_new_from_file (background_image, NULL);
-  scaled = scale_to_min (pixbuf,
-                         width,
-                         height);
 
-  w = gdk_pixbuf_get_width (scaled);
-  h = gdk_pixbuf_get_height (scaled);
+  w = gdk_pixbuf_get_width (pixbuf);
+  h = gdk_pixbuf_get_height (pixbuf);
   x = (width - w) / 2;
   y = (height - h) / 2;
 
   x = ABS(x);
   y = ABS(y);
 
-  return gdk_pixbuf_new_subpixbuf (scaled,
+  return gdk_pixbuf_new_subpixbuf (pixbuf,
                                    x,
                                    y,
                                    w - x,


Follow ups