*** empty log message ***
authorhanda <handa>
Wed, 21 Jan 2009 00:04:54 +0000 (00:04 +0000)
committerhanda <handa>
Wed, 21 Jan 2009 00:04:54 +0000 (00:04 +0000)
MText.cs

index d7a6dcf..ecc1689 100644 (file)
--- a/MText.cs
+++ b/MText.cs
@@ -279,7 +279,7 @@ namespace M17N.Core
       // position:    0           1           2           3
       // index:   -1  0  1  2  3  4  5  6  7  8  9  10 11 12 13
       //           |     |  A  |     |  B  |     |  C  |     |
-      // interval  |<--------->|<--->|<--------------->|<------
+      // interval  |<--------->|<--->|<--------------->|<----|
       // 
       //                   [-1 99 (9 89)]
       //       [0 10 (-1 9)]            [-10 0 (89 99)]
@@ -289,10 +289,10 @@ namespace M17N.Core
       // If this is the left node, the values are relative to the
       // parent's total_start.  Otherwise, the values are relative to
       // the parent's total_end.  So:
-      //                       total_start  total_end
-      //   left-side interval  0            positive
-      //   right-side interval negative     0
-      //   top-most interval   -1           positive
+      //                       total_start    total_end
+      //   left-side interval  0              positive even
+      //   right-side interval negative even  0
+      //   top-most interval   -1             positive odd
       private int total_start, total_end;
       // Stack of MTextProperty
       private Stack<MTextProperty> stack;
@@ -496,35 +496,23 @@ namespace M17N.Core
 
       private MInterval Left {
        get {
-         MInterval interval;
-
+         MInterval i;
          if (left != null)
-           for (interval = left;
-                interval.right != null;
-                interval = interval.right);
+           for (i = left; i.right != null; i = i.right);
          else
-           for (interval = parent;
-                interval != null && interval.total_start == 0;
-                interval = interval.parent);
-
-         return interval;
+           for (i = parent; i != null && i.total_start == 0; i = i.parent);
+         return i;
        }
       }
 
       private MInterval Right {
        get {
-         MInterval interval;
-
+         MInterval i;
          if (right != null)
-           for (interval = right;
-                interval.left != null;
-                interval = interval.left);
+           for (i = right; i.left != null; i = i.left);
          else
-           for (interval = parent;
-                interval != null && interval.total_start < 0;
-                interval = interval.parent);
-
-         return interval;
+           for (i = parent; i != null && i.total_start < 0; i = i.parent);
+         return i;
        }
       }
 
@@ -556,10 +544,12 @@ namespace M17N.Core
          {
            // position:    0           1           2           3
            // index:   -1  0  1  2  3  4  5  6  7  8  9  10 11 12 13
-           // this      |<----------<-------------->->|
-           //           |<--------->|              |<>|
+           // this      |<----------<----------->---->|
+           //           |<--------->|           |<--->|
            //
-           // interval                 |<->----->->|
+           //                              BBBBB
+           //                             AAAAA
+           // interval                    |<--->|
            //                             
            // new       |<----------<----->----->-->------------>->|
            //           |<--------->|     |<---->-->------------>->|