Last active
August 29, 2015 14:10
-
-
Save MihailJP/e474321574403e357d2e to your computer and use it in GitHub Desktop.
Patch for Kage engine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 249ab6765a7cd6753cb40885af3320a43a7dbacb Mon Sep 17 00:00:00 2001 | |
From: TANIGAWA Takashi <mihailjp@gmail.com> | |
Date: Sat, 6 Dec 2014 20:11:02 +0900 | |
Subject: [PATCH] Add top-right connecting start-point for U+4E41 | |
--- | |
engine/kagecd.js | 35 +++++++++++++++++++++++------------ | |
1 file changed, 23 insertions(+), 12 deletions(-) | |
diff --git a/engine/kagecd.js b/engine/kagecd.js | |
index 914cdbb..524ef07 100644 | |
--- a/engine/kagecd.js | |
+++ b/engine/kagecd.js | |
@@ -25,6 +25,7 @@ function cdDrawCurveU(kage, polygons, x1, y1, sx1, sy1, sx2, sy2, x2, y2, ta1, t | |
switch(a1 % 100){ | |
case 0: | |
case 7: | |
+ case 27: | |
delta = -1 * kage.kMinWidthY * 0.5; | |
break; | |
case 1: | |
@@ -168,10 +169,10 @@ function cdDrawCurveU(kage, polygons, x1, y1, sx1, sy1, sx2, sy2, x2, y2, ta1, t | |
ib = kMinWidthT; | |
} | |
- if(a1 == 7 && a2 == 0){ // L2RD: fatten | |
+ if((a1 == 7 || a1 == 27) && a2 == 0){ // L2RD: fatten | |
deltad = Math.pow(t, hosomi) * kage.kL2RDfatten; | |
} | |
- else if(a1 == 7){ | |
+ else if(a1 == 7 || a1 == 27){ | |
deltad = Math.pow(t, hosomi); | |
} | |
else if(a2 == 7){ | |
@@ -275,10 +276,10 @@ function cdDrawCurveU(kage, polygons, x1, y1, sx1, sy1, sx2, sy2, x2, y2, ta1, t | |
ib = kMinWidthT; | |
} | |
- if(a1 == 7 && a2 == 0){ // L2RD: fatten | |
+ if((a1 == 7 || a1 == 27) && a2 == 0){ // L2RD: fatten | |
deltad = Math.pow(t, hosomi) * kage.kL2RDfatten; | |
} | |
- else if(a1 == 7){ | |
+ else if(a1 == 7 || a1 == 27){ | |
deltad = Math.pow(t, hosomi); | |
deltad = Math.pow(deltad, 0.7); // make fatten | |
} | |
@@ -437,13 +438,18 @@ function cdDrawCurveU(kage, polygons, x1, y1, sx1, sy1, sx2, sy2, x2, y2, ta1, t | |
} | |
} | |
- if(a1 == 22){ //box's up-right corner, any time same degree | |
+ if(a1 == 22 || a1 == 27){ //box's up-right corner, any time same degree | |
poly = new Polygon(); | |
poly.push(x1 - kMinWidthT, y1 - kage.kMinWidthY); | |
poly.push(x1, y1 - kage.kMinWidthY - kage.kWidth); | |
poly.push(x1 + kMinWidthT + kage.kWidth, y1 + kage.kMinWidthY); | |
poly.push(x1 + kMinWidthT, y1 + kMinWidthT - 1); | |
- poly.push(x1 - kMinWidthT, y1 + kMinWidthT + 4); | |
+ if (a1 == 27) { | |
+ poly.push(x1, y1 + kMinWidthT + 2); | |
+ poly.push(x1, y1); | |
+ } else { | |
+ poly.push(x1 - kMinWidthT, y1 + kMinWidthT + 4); | |
+ } | |
polygons.push(poly); | |
} | |
@@ -565,7 +571,7 @@ function cdDrawCurveU(kage, polygons, x1, y1, sx1, sy1, sx2, sy2, x2, y2, ta1, t | |
} | |
} | |
- if(a2 == 9 || (a1 == 7 && a2 == 0)){ // Math.sinnyu & L2RD Harai ... no need for a2=9 | |
+ if(a2 == 9 || ((a1 == 7 || a1 == 27) && a2 == 0)){ // Math.sinnyu & L2RD Harai ... no need for a2=9 | |
var type = (Math.atan2(Math.abs(y2 - sy2), Math.abs(x2 - sx2)) / Math.PI * 2 - 0.6); | |
if(type > 0){ | |
type = type * 8; | |
@@ -851,7 +857,7 @@ function cdDrawLine(kage, polygons, tx1, ty1, tx2, ty2, ta1, ta2){ | |
polygons.push(poly); | |
- if(a1 == 22){ //box's right top corner | |
+ if(a1 == 22 || a1 == 27){ //box's right top corner | |
poly = new Polygon(); | |
poly.push(x1 - kMinWidthT, y1 - kage.kMinWidthY); | |
poly.push(x1, y1 - kage.kMinWidthY - kage.kWidth); | |
@@ -1105,13 +1111,18 @@ function cdDrawLine(kage, polygons, tx1, ty1, tx2, ty2, ta1, ta2){ | |
polygons.push(poly); | |
} | |
- if(a1 == 22){ //SHIKAKU MIGIUE UROKO NANAME DEMO MASSUGU MUKI | |
+ if(a1 == 22 || a1 == 27){ //SHIKAKU MIGIUE UROKO NANAME DEMO MASSUGU MUKI | |
poly = new Polygon(); | |
poly.push(x1 - kMinWidthT, y1 - kage.kMinWidthY); | |
poly.push(x1, y1 - kage.kMinWidthY - kage.kWidth); | |
poly.push(x1 + kMinWidthT + kage.kWidth, y1 + kage.kMinWidthY); | |
poly.push(x1 + kMinWidthT, y1 + kMinWidthT - 1); | |
- poly.push(x1 - kMinWidthT, y1 + kMinWidthT + 4); | |
+ if (a1 == 27) { | |
+ poly.push(x1, y1 + kMinWidthT + 2); | |
+ poly.push(x1, y1); | |
+ } else { | |
+ poly.push(x1 - kMinWidthT, y1 + kMinWidthT + 4); | |
+ } | |
polygons.push(poly); | |
} | |
-- | |
2.1.2 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment