X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fimage.c;h=8ccf1fcbe81350e15ed3502299e481600c109266;hb=59ee473b86e7cbc1d9b09a3c22b0bbd3a410f16f;hp=85a73a54f2a29322acb80ce9e4b9fab4f779ebd7;hpb=ae9c6c4794c6a8f9704850427de3ebbe933400da;p=rocksndiamonds.git diff --git a/src/libgame/image.c b/src/libgame/image.c index 85a73a54..8ccf1fcb 100644 --- a/src/libgame/image.c +++ b/src/libgame/image.c @@ -649,7 +649,11 @@ void ZoomPixmap(Display *display, GC gc, Pixmap src_pixmap, Pixmap dst_pixmap, if (scale_down) { +#if 1 + zoom_factor = MIN(src_width / dst_width, src_height / dst_height); +#else zoom_factor = src_width / dst_width; +#endif /* adjust source image size to integer multiple of destination size */ src_width = dst_width * zoom_factor; @@ -657,7 +661,11 @@ void ZoomPixmap(Display *display, GC gc, Pixmap src_pixmap, Pixmap dst_pixmap, } else { +#if 1 + zoom_factor = MIN(dst_width / src_width, dst_height / src_height); +#else zoom_factor = dst_width / src_width; +#endif /* no adjustment needed when scaling up (some pixels may be left blank) */ }