From 9361876fc803e02e7f23c9193a74f960b25a9784 Mon Sep 17 00:00:00 2001 From: handa Date: Wed, 21 Jan 2009 00:04:54 +0000 Subject: [PATCH] *** empty log message *** --- MText.cs | 46 ++++++++++++++++++---------------------------- 1 file changed, 18 insertions(+), 28 deletions(-) diff --git a/MText.cs b/MText.cs index d7a6dcf..ecc1689 100644 --- 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 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 |<----------<----->----->-->------------>->| // |<--------->| |<---->-->------------>->| -- 1.7.10.4