1. fix scalecache to actually respect env vars set!
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 13 May 2009 12:20:14 +0000 (12:20 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 13 May 2009 12:20:14 +0000 (12:20 +0000)
2. fix textblock cursor stuff in corner case.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@40617 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/canvas/evas_object_textblock.c
src/lib/engines/common/evas_image_scalecache.c

index fed1e0d..2e4a888 100644 (file)
@@ -2259,12 +2259,22 @@ _find_layout_item_line_match(Evas_Object *obj, Evas_Object_Textblock_Node *n, in
      {
        Evas_Object_Textblock_Format_Item *fit;
        Evas_Object_Textblock_Item *it;
-
+        Evas_Object_Textblock_Line *lnn;
+        
+        lnn = (Evas_Object_Textblock_Line *)(((Eina_Inlist *)ln)->next);
        EINA_INLIST_FOREACH(ln->items, it)
          {
             if (it->source_node == n)
               {
-                 if ((int)(it->source_pos + strlen(it->text)) >= pos)
+                  Evas_Object_Textblock_Item *itn;
+                  int p;
+                  
+                  itn = (Evas_Object_Textblock_Item *)(((Eina_Inlist *)it)->next);
+                  p = (int)(it->source_pos + strlen(it->text));
+                 if ((p > pos) || 
+                      ((p == pos) && (!lnn) &&
+                       ((!itn)  |
+                        ((itn) && (itn->source_node != n)))))
                    {
                       *lnr = ln;
                       *itr = it;
index 53e2af1..d3bb57d 100644 (file)
@@ -197,7 +197,7 @@ _sci_find(RGBA_Image *im,
 {
    Eina_List *l;
    Scaleitem *sci;
-   
+
    EINA_LIST_FOREACH(im->cache.list, l, sci)
      {
         if (
@@ -236,9 +236,14 @@ _sci_find(RGBA_Image *im,
 //             printf(" 1- %i\n", sci->dst_w * sci->dst_h * 4);
              cache_list = eina_inlist_remove(cache_list, (Eina_Inlist *)sci);
           }
+        if (max_scale_items < 1) return NULL;
      }
    else
      {
+        if (max_scale_items < 1) return NULL;
+
+        if (eina_list_count(im->cache.list) > (max_scale_items - 1))
+          return NULL;
         sci = malloc(sizeof(Scaleitem));
         memset(sci, 0, sizeof(Eina_Inlist));
         sci->parent_im = im;
@@ -376,6 +381,12 @@ evas_common_rgba_image_scalecache_prepare(Image_Entry *ie, RGBA_Image *dst,
    sci = _sci_find(im, dc, smooth, 
                    src_region_x, src_region_y, src_region_w, src_region_h, 
                    dst_region_w, dst_region_h);
+   if (!sci)
+     {
+        LKU(cache_lock);
+        LKU(im->cache.lock);
+        return;
+     }
 //   printf("%10i | %4i %4i %4ix%4i -> %4i %4i %4ix%4i | %i\n",
 //          (int)use_counter,
 //          src_region_x, src_region_y, src_region_w, src_region_h,