Fix -tile option; from Remi Guyomarch <rguyom@pobox.com> via FreeBSD.

This commit is contained in:
naddy 2001-07-10 21:31:55 +00:00
parent 441f96e032
commit 22ddeb3e43

View File

@ -0,0 +1,31 @@
$OpenBSD: patch-merge_c,v 1.1 2001/07/10 21:31:55 naddy Exp $
--- merge.c.orig Thu Oct 21 22:28:39 1993
+++ merge.c Tue Jul 10 23:22:25 2001
@@ -244,6 +244,7 @@ Image *tile(image, x, y, width, height,
int x, y;
unsigned int width, height, verbose;
{ Image *base, *tmp;
+ int nx, ny;
if (verbose) {
printf(" Tiling...");
@@ -259,16 +260,14 @@ Image *tile(image, x, y, width, height,
else
base = newTrueImage(width, height);
- while (x < base->width) {
- while(y < base->height) {
- tmp = merge(base, image, x, y, 0);
+ for (nx = x; nx < base->width; nx += image->width) {
+ for(ny = y; ny < base->height; ny += image->height) {
+ tmp = merge(base, image, nx, ny, 0);
if (tmp != base) {
freeImage(base);
base = tmp;
}
- y += image->width;
}
- x += image->width;
}
printf("done.\n");
return(base);