Changeset 11351:5e03767bf986 in orange


Ignore:
Timestamp:
02/21/13 12:27:21 (14 months ago)
Author:
markotoplak
Branch:
default
Message:

When dragging widgets, a a new widget should be placed so that the connection stays as it was.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeCanvas/document/interactions.py

    r11343 r11351  
    381381            desc = item.data(QtWidgetRegistry.WIDGET_DESC_ROLE).toPyObject() 
    382382            pos = event.scenePos() 
     383            # a new widget should be placed so that the connection 
     384            # stays as it was 
     385            offset = 31 * (-1 if self.direction == self.FROM_SINK else 
     386                           1 if self.direction == self.FROM_SOURCE else 0) 
    383387            node = self.document.newNodeHelper(desc, 
    384                                                position=(pos.x(), pos.y())) 
     388                                               position=(pos.x() + offset, 
     389                                                         pos.y())) 
    385390            return node 
    386  
    387391 
    388392    def connect_existing(self, node): 
Note: See TracChangeset for help on using the changeset viewer.