ui/common/context.c

changeset 90
2019fdbaadfd
parent 88
04c81be1c5a0
child 94
d51e334c1439
--- a/ui/common/context.c	Sun Feb 15 15:44:24 2015 +0100
+++ b/ui/common/context.c	Tue Feb 17 20:12:22 2015 +0100
@@ -174,7 +174,7 @@
             return var;
         }
     } else {
-        // create an empty value and add it first to the window variables
+        // create an empty value and add it to the window variables
         // it can be moved to the document vars later
         void *value = uic_create_value(ctx->mempool->allocator, type);
         if(!value) {
@@ -217,11 +217,14 @@
             UiText *f = from->value;
             UiText *t = to->value;
             char *tvalue = t->value;
+            int tpos = t->pos;
             memcpy(t, f, sizeof(UiText));
             if(set && tvalue) {
                 t->set(t, tvalue);
+                t->setposition(t, tpos);
             } else {
                 f->value = f->get(f);
+                f->pos = f->position(f);
             }
             break;
         }

mercurial