Ignore:
Timestamp:
11/28/12 12:31:29 (17 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Fixed anchor point layout order reset while dragging (creating) a new link.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeCanvas/canvas/layout.py

    r11180 r11207  
    77import numpy 
    88 
     9import sip 
     10 
    911from PyQt4.QtGui import QGraphicsObject 
    1012from PyQt4.QtCore import QRectF, QLineF, QTimer 
    1113 
    1214from .items import NodeItem, LinkItem, SourceAnchorItem, SinkAnchorItem 
    13 from .items.nodeitem import linspace 
    14 from .items.utils import typed_signal_mapper 
     15from .items.utils import typed_signal_mapper, invert_permutation_indices, \ 
     16                         linspace 
    1517 
    1618LinkItemSignalMapper = typed_signal_mapper(LinkItem) 
     
    6466 
    6567        for anchor_item in anchors: 
     68            if sip.isdeleted(anchor_item): 
     69                continue 
     70 
    6671            points = anchor_item.anchorPoints() 
    6772            anchor_pos = anchor_item.mapToScene(anchor_item.pos()) 
     
    7782            indices = list(numpy.argsort(others_angle)) 
    7883            # Invert the indices. 
    79             indices = [indices.index(i) for i in range(len(indices))] 
     84            indices = invert_permutation_indices(indices) 
    8085 
    8186            positions = numpy.array(linspace(len(points))) 
Note: See TracChangeset for help on using the changeset viewer.