]> Dogcows Code - chaz/openbox/commitdiff
Prefer to use larger images and scale down than to scale up (more distortion)
authorDana Jansens <danakj@orodu.net>
Thu, 14 Jan 2010 20:03:06 +0000 (15:03 -0500)
committerDana Jansens <danakj@orodu.net>
Thu, 14 Jan 2010 20:03:06 +0000 (15:03 -0500)
render/image.c

index 48012d42b79abfb1001fae0d495425dffe7f635d..3698e81dff29b23f63db6212fc9b04fa667cd876 100644 (file)
@@ -463,7 +463,9 @@ void RrImageDrawImage(RrPixel32 *target, RrTextureImage *img,
 
             /* our size difference metric.. */
             wdiff = self->original[i]->width - area->width;
+            if (wdiff < 0) wdiff *= 2; /* prefer scaling down than up */
             hdiff = self->original[i]->height - area->height;
+            if (hdiff < 0) hdiff *= 2; /* prefer scaling down than up */
             diff = (wdiff * wdiff) + (hdiff * hdiff);
 
             /* find the smallest difference */
This page took 0.027196 seconds and 4 git commands to generate.