Changeset 1837

Show
Ignore:
Timestamp:
08/04/07 14:45:50 (1 year ago)
Author:
wrobe..@pld-linux.org
Message:

- update item's matrix and solve item's internal constraints when pasting

an item

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gaphor/trunk/gaphor/diagram/diagramline.py

    r1747 r1837  
    114114            h = self.head 
    115115 
    116             x, y = self.canvas.get_matrix_i2c(self).transform_point(h.x, h.y) 
    117             x, y = self.canvas.get_matrix_c2i(self._load_head_connection).transform_point(x, y) 
    118             adapter.connect(h, x, y) 
     116            adapter.connect(h, float(h.x), float(h.y)) 
    119117            del self._load_head_connection 
    120118 
     
    124122            h = self.tail 
    125123 
    126             x, y = self.canvas.get_matrix_i2c(self).transform_point(h.x, h.y) 
    127             x, y = self.canvas.get_matrix_c2i(self._load_tail_connection).transform_point(x, y) 
    128             adapter.connect(h, x, y) 
     124            adapter.connect(h, float(h.x), float(h.y)) 
    129125            del self._load_tail_connection 
    130126        LineItem.postload(self) 
  • gaphor/trunk/gaphor/services/copyservice.py

    r1362 r1837  
    122122            ci.save(self.copy_func) 
    123123 
     124        # move pasted items a bit, so user can see result of his action :) 
     125        # update items' matrix immediately 
     126        # TODO: if it is new canvas, then let's not move, how to do it? 
    124127        for item in self._new_items.values(): 
    125128            item.matrix.translate(10, 10) 
     129            canvas.update_matrix(item) 
    126130 
     131        # solve internal constraints of items immediately as item.postload 
     132        # reconnects items and all handles has to be in place 
     133        canvas.solver.solve() 
    127134        for item in self._new_items.values(): 
    128135            item.postload()