From: Koichi KAMICHI Date: Fri, 25 Feb 2005 05:29:44 +0000 (+0000) Subject: Adjusted upper-bottom combining function. X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=3617b6eb171e4f691ff03c47b339cb5bd7c9f07b;p=chise%2Fkage.git Adjusted upper-bottom combining function. --- diff --git a/kagecgi/kagecomb.c b/kagecgi/kagecomb.c index 4fb99e7..875cd85 100755 --- a/kagecgi/kagecomb.c +++ b/kagecgi/kagecomb.c @@ -384,7 +384,7 @@ void combineTate2(const KGString *parts1, const KGString *parts3, int *result){ k = 0; for(i = 0; i < pngWidth * 1.1; i++){ for(j = chk_x1; j <= chk_x2; j++){ - if(kageCanvas[i][j] == 0) k++; + if(kageCanvas[i][j] != kWhite) k++; } } l = k; @@ -399,16 +399,25 @@ void combineTate2(const KGString *parts1, const KGString *parts3, int *result){ l = 0; for(i = 0; i < pngWidth * 1.1; i++){ for(j = chk_x1; j <= chk_x2; j++){ - if(kageCanvas[i][j] == 0) l++; + if(kageCanvas[i][j] != kWhite) l++; } } } pyR = f; +/* if(k - l > pngWidth * 0.4){ pyR = pyR + kWidth * 4; } else { pyR = pyR + kWidth * 2; } +*/ + if(flg_boxL & FLAG_FLAT_BOTTOM && flg_boxR & FLAG_FLAT_TOP){ + pyR = pyR + kWidth * 4; + } else if(k - l > pngWidth * 0.4){ + pyR = pyR + kWidth * 2; + } else { + pyR = pyR + kWidth; + } //set results result[0] = pxL;