summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/evas/common/evas_text_utils.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/lib/evas/common/evas_text_utils.c b/src/lib/evas/common/evas_text_utils.c
index fe17101..d7aa3ad 100644
--- a/src/lib/evas/common/evas_text_utils.c
+++ b/src/lib/evas/common/evas_text_utils.c
@@ -117,8 +117,16 @@ _evas_common_text_props_cluster_move(const Evas_Text_Props *props, int pos,
117 if (!right && (prop_pos > 0)) 117 if (!right && (prop_pos > 0))
118 { 118 {
119#ifdef OT_SUPPORT 119#ifdef OT_SUPPORT
120 return props->info->ot[props->start + prop_pos - 1].source_cluster - 120 int base_cluster = props->info->ot[props->start + prop_pos].source_cluster;
121 props->text_offset; 121 prop_pos--;
122 for ( ; prop_pos >= 0 ; prop_pos--)
123 {
124 int cur_cluster = props->info->ot[props->start + prop_pos].source_cluster;
125 if (cur_cluster != base_cluster)
126 {
127 return cur_cluster - props->text_offset;
128 }
129 }
122#else 130#else
123 return props->start + prop_pos - 1 - props->text_offset; 131 return props->start + prop_pos - 1 - props->text_offset;
124#endif 132#endif
@@ -126,8 +134,16 @@ _evas_common_text_props_cluster_move(const Evas_Text_Props *props, int pos,
126 else if (right && (prop_pos < (int) (props->len - 1))) 134 else if (right && (prop_pos < (int) (props->len - 1)))
127 { 135 {
128#ifdef OT_SUPPORT 136#ifdef OT_SUPPORT
129 return props->info->ot[props->start + prop_pos + 1].source_cluster - 137 int base_cluster = props->info->ot[props->start + prop_pos].source_cluster;
130 props->text_offset; 138 prop_pos++;
139 for ( ; prop_pos < (int) props->len ; prop_pos++)
140 {
141 int cur_cluster = props->info->ot[props->start + prop_pos].source_cluster;
142 if (cur_cluster != base_cluster)
143 {
144 return cur_cluster - props->text_offset;
145 }
146 }
131#else 147#else
132 return props->start + prop_pos + 1 - props->text_offset; 148 return props->start + prop_pos + 1 - props->text_offset;
133#endif 149#endif