Changeset 1886

Show
Ignore:
Timestamp:
08/09/07 01:58:01 (1 year ago)
Author:
arj..@yirdis.nl
Message:

use consistent naming in handle tool.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gaphor/trunk/gaphor/ui/diagramtools.py

    r1884 r1886  
    4545 
    4646 
    47     def glue(self, view, item, handle, x, y): 
     47    def glue(self, view, item, handle, vx, vy): 
    4848        """ 
    4949        Find the nearest item that the handle may connect to. 
    5050 
    51         This is done by iterating over all items and query for an IConnect 
    52         adapter for (itered_item, @item). If such an adapter exists, th
    53         glue position is determined. The item with the glue point closest 
    54         to the handle will be glued to. 
     51        This is done by checking for an IConnect adapter for all items in the 
     52        proximity of ``(vx, xy)``.  If such an adapter exists, the glu
     53        position is determined. The item with the glue point closest to the 
     54        handle will be glued to. 
    5555 
    5656        view: The view 
    5757        item: The item who's about to connect, owner of handle 
    5858        handle: the handle to connect 
    59         cx, cy: handle position in canvas coordinates 
     59        vx, vy: handle position in view coordinates 
    6060        """ 
    6161        # localize methods 
     
    7070        glue_pos = (0, 0) 
    7171        glue_item = None 
    72         for i in view.get_items_in_rectangle((x - dist, y - dist, 
     72        for i in view.get_items_in_rectangle((vx - dist, vy - dist, 
    7373                                              dist * 2, dist * 2), 
    7474                                             reverse=True): 
     
    7777             
    7878            b = get_item_bounding_box(i) 
    79             ix, iy = v2i(i).transform_point(x, y) 
    80             if drp(b, (x, y)) >= max_dist: 
     79            ix, iy = v2i(i).transform_point(vx, vy) 
     80            if drp(b, (vx, vy)) >= max_dist: 
    8181                continue 
    8282             
     
    100100 
    101101 
    102     def connect(self, view, item, handle, x, y): 
    103         """ 
    104         Find an item near @handle that @item can connect to and connect. 
     102    def connect(self, view, item, handle, vx, vy): 
     103        """ 
     104        Find an item near ``handle`` that ``item`` can connect to and connect. 
    105105         
    106106        This is done by attempting a glue() operation. If there is something 
     
    110110        connected = False 
    111111        try: 
    112             glue_item = self.glue(view, item, handle, x, y) 
     112            glue_item = self.glue(view, item, handle, vx, vy) 
    113113 
    114114            if glue_item: