/[ascend]/trunk/pygtk/canvas/blockcanvas.py
ViewVC logotype

Diff of /trunk/pygtk/canvas/blockcanvas.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1979 by jpye, Sat Jan 10 00:21:37 2009 UTC revision 1980 by jpye, Mon Jan 12 07:07:02 2009 UTC
# Line 18  class BlockCanvas(Canvas): Line 18  class BlockCanvas(Canvas):
18    
19          super(BlockCanvas,self).update_constraints(items)          super(BlockCanvas,self).update_constraints(items)
20    
     def _normalize(self, items):  
         """  
         Correct offset of ports due to movement of left-side handles.  
         """  
         dirty_matrix_items = set()  
         for item in items:  
             if not hasattr(item, 'ports'):  
                 continue  
             handles = item.handles()  
             ports = item._ports  
             if not handles or not ports:  
                 continue  
             x, y = map(float, handles[0].pos)  
             # Dirty marking is done by the superclass' method  
             if x:  
                 for p in ports:  
                     if hasattr(p,"point"):  
                         p.point.x._value -= x  
             if y:  
                 for p in ports:  
                     if hasattr(p,"point"):  
                         p.point.y._value -= y  
         dirty_matrix_items.update(super(BlockCanvas, self)._normalize(items))  
         return dirty_matrix_items  
   
21      def reattach_ascend(self, library, notesdb):      def reattach_ascend(self, library, notesdb):
22          """          """
23          After unpickling a canvas, this method gives a way of reattaching          After unpickling a canvas, this method gives a way of reattaching

Legend:
Removed from v.1979  
changed lines
  Added in v.1980

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22