From: Koichi KAMICHI Date: Sun, 15 Feb 2004 13:14:53 +0000 (+0000) Subject: Change internal data type of coordinate. (from `int' to `double') X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b0347c621ae432bb537cfb0576ba932eeddfe0e;p=chise%2Fkage.git Change internal data type of coordinate. (from `int' to `double') --- diff --git a/kagecgi/kage.h b/kagecgi/kage.h index b11c5c6..9bc33dc 100755 --- a/kagecgi/kage.h +++ b/kagecgi/kage.h @@ -26,8 +26,8 @@ int kShotai; #define kMaxStrokeDataLength 256 // over 12(digits per integer with +/- flag) * 11(columns) + 1(line end) struct kPoint{ - int X; - int Y; + double X; + double Y; }; XPoint xpoly[kResolution]; @@ -49,8 +49,8 @@ struct EDGE { //kagedf.c void dfDrawFont(int, int, int, int, int, int, int, int, int, int, int); //kagecd.c -void cdDrawCurve(int, int, int, int, int, int, int, int); -void cdDrawLine(int, int, int, int, int, int); +void cdDrawCurve(double, double, double, double, double, double, int, int); +void cdDrawLine(double, double, double, double, int, int); //kageic.c void icPolygon(struct kPoint *, int); diff --git a/kagecgi/kagecd.c b/kagecgi/kagecd.c index 61087eb..62d1afe 100755 --- a/kagecgi/kagecd.c +++ b/kagecgi/kagecd.c @@ -2,16 +2,16 @@ // #include "kage.h" -void cdDrawCurve(int x1, int y1, - int x2, int y2, - int x3, int y3, +void cdDrawCurve(double x1, double y1, + double x2, double y2, + double x3, double y3, int a1, int a2){ double rad, t; double x, y, v; double ix, iy, ia, ib, ir; int count, tt; - int delta; + double delta; double deltad; double XX, XY, YX, YY; @@ -562,9 +562,10 @@ void cdDrawCurve(int x1, int y1, } } -void cdDrawLine(int tx1, int ty1, int tx2, int ty2, int ta1, int ta2){ +void cdDrawLine(double tx1, double ty1, double tx2, double ty2, int ta1, int ta2){ double rad; - int v, x1, y1, x2, y2, a1, a2; + double v, x1, y1, x2, y2; + int a1, a2; double XX, XY, YX, YY; if(kShotai == kMincho){ //mincho diff --git a/kagecgi/kageic.c b/kagecgi/kageic.c index eadef07..98ccbe4 100755 --- a/kagecgi/kageic.c +++ b/kagecgi/kageic.c @@ -15,20 +15,20 @@ void icPolygon(struct kPoint *poly, int number){ sprintf(buf, ""); g_string_append(kResultText, buf); } else if(kMode == 2){ //output for eps - sprintf(buf, "%d %d moveto\n", poly[0].X * 5, 1000 - (poly[0].Y * 5) - 200); + sprintf(buf, "%.0f %.0f moveto\n", poly[0].X * 5, 1000 - (poly[0].Y * 5) - 200); g_string_append(kResultText, buf); for(i = 1; i < number; i++){ - sprintf(buf, " %d %d lineto\n", poly[i].X * 5, 1000 - (poly[i].Y * 5) - 200); + sprintf(buf, " %.0f %.0f lineto\n", poly[i].X * 5, 1000 - (poly[i].Y * 5) - 200); g_string_append(kResultText, buf); } - sprintf(buf, " %d %d lineto\n", poly[0].X * 5, 1000 - (poly[0].Y * 5) - 200); + sprintf(buf, " %.0f %.0f lineto\n", poly[0].X * 5, 1000 - (poly[0].Y * 5) - 200); g_string_append(kResultText, buf); g_string_append(kResultText, "closepath\n"); }