Ticket #3944: 0001-Avoid-collisions-with-central-buddy-SL-3944.patch

File 0001-Avoid-collisions-with-central-buddy-SL-3944.patch, 1.4 KB (added by humitos, 11 years ago)

This patch reduces the probability to collide with the central buddy (locked position). It marks the icon to be re-arranged if it collides with the central buddy.

  • src/jarabe/desktop/grid.py

    From 344cdef1ec3b1d110118f2f931f493d7741195e4 Mon Sep 17 00:00:00 2001
    From: Manuel Kaufmann <humitos@gmail.com>
    Date: Mon, 10 Dec 2012 18:34:57 -0300
    Subject: [PATCH sugar 1/2] Avoid collisions with central buddy SL #3944
    
    When a collision is detected:
    
     - if one of the icons is locked, just add the other (free) one to the
       collision list
    
     - if no one of them are locked, add both to the collision list
    
    This decrease the possibility to collide with locked icons because
    they (the icons who collide) are added to the collision list and then
    '__solve_collisions_cb' is called to try to re-organize them.
    
    Signed-off-by: Manuel Kaufmann <humitos@gmail.com>
    ---
     src/jarabe/desktop/grid.py | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/src/jarabe/desktop/grid.py b/src/jarabe/desktop/grid.py
    index 9d6d820..83404e2 100644
    a b class Grid(SugarExt.Grid): 
    201201            intersects_, intersection = Gdk.rectangle_intersect(
    202202                child_rect, self._child_rects[c])
    203203            if c != child and intersection.width > 0:
     204                collision_found = True
    204205                if (c not in self._locked_children and
    205206                    c not in self._collisions):
    206                     collision_found = True
    207207                    self._collisions.append(c)
    208208
    209209        if collision_found: