Added adjust size of UROKO function.
authorKoichi KAMICHI <kamichi@fonts.jp>
Fri, 25 Feb 2005 04:29:10 +0000 (04:29 +0000)
committerKoichi KAMICHI <kamichi@fonts.jp>
Fri, 25 Feb 2005 04:29:10 +0000 (04:29 +0000)
kagecgi/kage.h
kagecgi/kagecd.c

index 9809dad..c806c9a 100755 (executable)
@@ -24,6 +24,7 @@ int kShotai;
 #define kKasane 3
 #define kMixdot (kWidth * 2) * (kWidth * 2 - 1)
 #define kL2RDfatten 1.1
+#define kUroko 24
 
 #define kMaxIDSSequenceLength 16
 #define kMaxIDCLength 16
index aba66c6..17c6a91 100755 (executable)
@@ -1,6 +1,7 @@
 //kagecd.c\r
 //\r
 #include "kage.h"\r
+#include "kagecgi.h"\r
 \r
 void cdDrawBezier(double x1, double y1,\r
        double x2, double y2,\r
@@ -1033,10 +1034,11 @@ void cdDrawCurve(double x1, double y1,
 }\r
 \r
 void cdDrawLine(double tx1, double ty1, double tx2, double ty2, int ta1, int ta2){\r
-       double rad;\r
-       double v, x1, y1, x2, y2;\r
-       int a1, a2;\r
-       double XX, XY, YX, YY;\r
+  double rad;\r
+  double v, x1, y1, x2, y2;\r
+  int a1, a2;\r
+  double XX, XY, YX, YY;\r
+  int uroko;\r
        \r
        if(kShotai == kMincho){ //mincho\r
                x1 = tx1;\r
@@ -1231,13 +1233,17 @@ void cdDrawLine(double tx1, double ty1, double tx2, double ty2, int ta1, int ta2
                                \r
                                //UROKO\r
                                if(a2 == 0){\r
-                                       poly2[0].X = x2;\r
-                                       poly2[0].Y = y2 - kMinWidthY;\r
-                                       poly2[1].X = x2 - 24;\r
-                                       poly2[1].Y = y2;\r
-                                       poly2[2].X = x2 - 12;\r
-                                       poly2[2].Y = y2 - 12;\r
-                                       icPolygon(poly2, 3);\r
+                                  uroko = kUroko;\r
+                                  if((x2 - x1 - kWidth) < uroko){\r
+                                    uroko = max((x2 - x1 - kWidth), 4);\r
+                                  }\r
+                                  poly2[0].X = x2;\r
+                                  poly2[0].Y = y2 - kMinWidthY;\r
+                                  poly2[1].X = x2 - uroko;\r
+                                  poly2[1].Y = y2;\r
+                                  poly2[2].X = x2 - uroko / 2;\r
+                                  poly2[2].Y = y2 - uroko / 2;\r
+                                  icPolygon(poly2, 3);\r
                                }\r
                        }\r
                }\r
@@ -1277,12 +1283,16 @@ void cdDrawLine(double tx1, double ty1, double tx2, double ty2, int ta1, int ta2
                                \r
                                //UROKO\r
                                if(a2 == 0){\r
+                                  uroko = kUroko;\r
+                                  if((x2 - x1 - kWidth * cos(rad)) < uroko * cos(rad)){\r
+                                    uroko = max(((x2 - x1) / cos(rad) - kWidth), 4);\r
+                                  }\r
                                        poly2[0].X = x2 + sin(rad) * kMinWidthY;\r
                                        poly2[0].Y = y2 - cos(rad) * kMinWidthY;\r
-                                       poly2[1].X = x2 - cos(rad) * 24;\r
-                                       poly2[1].Y = y2 - sin(rad) * 24;\r
-                                       poly2[2].X = x2 - cos(rad) * 12 + sin(rad) * 12;\r
-                                       poly2[2].Y = y2 - sin(rad) * 12 - cos(rad) * 12;\r
+                                       poly2[1].X = x2 - cos(rad) * uroko;\r
+                                       poly2[1].Y = y2 - sin(rad) * uroko;\r
+                                       poly2[2].X = x2 - cos(rad) * uroko / 2 + sin(rad) * uroko / 2;\r
+                                       poly2[2].Y = y2 - sin(rad) * uroko / 2 - cos(rad) * uroko / 2;\r
                                        icPolygon(poly2, 3);\r
                                }\r
                        }\r