From: Dana Jansens Date: Thu, 14 Jan 2010 20:03:06 +0000 (-0500) Subject: Prefer to use larger images and scale down than to scale up (more distortion) X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=7e6b2eaef734039c5ee4c32e345284efc88bf487;p=chaz%2Fopenbox Prefer to use larger images and scale down than to scale up (more distortion) --- diff --git a/render/image.c b/render/image.c index 48012d42..3698e81d 100644 --- a/render/image.c +++ b/render/image.c @@ -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 */