X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=render%2Fimage.c;h=393afe84973babece9e74a974ae9104992323b32;hb=3b83230aafd70dafc97fe1a148873a948044ed9c;hp=1c79d6941182ff63855a9dc44e495edb2ebbcc65;hpb=c4e4760c41f10aae6af19a4363cb247c71edee4b;p=chaz%2Fopenbox diff --git a/render/image.c b/render/image.c index 1c79d694..393afe84 100644 --- a/render/image.c +++ b/render/image.c @@ -1,4 +1,4 @@ -/* -*- indent-tabs-mode: t; tab-width: 4; c-basic-offset: 4; -*- +/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*- image.c for the Openbox window manager Copyright (c) 2003 Ben Jansens @@ -133,12 +133,15 @@ void RrImageDraw(RrPixel32 *target, RrTextureRGBA *rgba, /* keep the ratio */ dw = area->width; - dh = (int)(dw * ((double)sh / sw)); + dh = (gint)(dw * ((gdouble)sh / sw)); if (dh > area->height) { dh = area->height; - dw = (int)(dh * ((double)sw / sh)); + dw = (gint)(dh * ((gdouble)sw / sh)); } + if (!(dw && dh)) + return; /* XXX sanity check */ + if (sw != dw || sh != dh) { /*if (!(rgba->cache && dw == rgba->cwidth && dh == rgba->cheight))*/ { g_free(rgba->cache);