Changeset 1839
- Timestamp:
- 08/06/07 00:02:17 (1 year ago)
- Files:
-
- gaphas/trunk/gaphas/item.py (modified) (3 diffs)
- gaphas/trunk/gaphas/matrix.py (modified) (1 diff)
- gaphas/trunk/gaphas/view.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
gaphas/trunk/gaphas/item.py
r1816 r1839 7 7 8 8 from math import atan2 9 from weakref import WeakKeyDictionary 9 10 10 11 from matrix import Matrix … … 118 119 Attributes: 119 120 120 - _canvas: canvas, which owns an item 121 - _handles: list of handles owned by an item 122 - _constraints: item's constraints 123 - matrix: item's transformation matrix 124 - _matrix_i2c: item to canvas coordinates matrix 125 - _matrix_c2i: canvas to item coordinates matrix 126 - _matrix_i2v: item to view coordinates matrices 127 - _matrix_v2i: view to item coordinates matrices 128 - _sort_key: used to sort items 121 :matrix: item's transformation matrix 122 :canvas: canvas, which owns an item 123 124 Private: 125 126 :_canvas: canvas, which owns an item 127 :_handles: list of handles owned by an item 128 :_constraints: item's constraints 129 :_matrix_i2c: item to canvas coordinates matrix 130 :_matrix_c2i: canvas to item coordinates matrix 131 :_matrix_i2v: item to view coordinates matrices 132 :_matrix_v2i: view to item coordinates matrices 133 :_sort_key: used to sort items 129 134 """ 130 135 … … 135 140 self._constraints = [] 136 141 142 # used by gaphas.canvas.Canvas to hold conversion matrices 137 143 self._matrix_i2c = None 138 144 self._matrix_2ci = None 139 self._matrix_i2v = {} 140 self._matrix_v2i = {} 141 145 146 # used by gaphas.view.View to hold item 2 view matrices (view=key) 147 self._matrix_i2v = WeakKeyDictionary() 148 self._matrix_v2i = WeakKeyDictionary() 149 150 # Used by gaphas.sorter.Sorter to order items fast. 142 151 self._sort_key = None 143 152 gaphas/trunk/gaphas/matrix.py
r1732 r1839 4 4 5 5 Matrix 6 ------ --------7 Small utility class wrapping cairo.Matrix. The UndoableMatrixclass6 ------ 7 Small utility class wrapping cairo.Matrix. The `Matrix` class 8 8 adds state preservation capabilities. 9 9 """ gaphas/trunk/gaphas/view.py
r1838 r1839 639 639 def do_unrealize(self): 640 640 if self.canvas: 641 # Although Item._matrix_{i2v|v2i} keys are automatically removed 642 # (weak refs), better do it explicitly to be sure. 641 643 for item in self.canvas.get_all_items(): 642 644 try:
