Changeset 1622

Show
Ignore:
Timestamp:
07/11/07 23:47:54 (1 year ago)
Author:
arj..@yirdis.nl
Message:

fixed sample tool. Added docstring to View.matrix

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gaphas/branches/hw/gaphas/examples.py

    r1611 r1622  
    1414from geometry import point_on_rectangle, distance_rectangle_point 
    1515from util import text_extents, text_align, text_multiline, path_ellipse 
     16from cairo import Matrix 
    1617 
    1718class Box(Element): 
     
    168169 
    169170        # Make glue distance depend on the zoom ratio (should be about 10 pixels) 
    170         glue_distance, dummy = view.transform_distance_c2w(10, 0) 
     171        inverse = Matrix(*view.matrix) 
     172        inverse.invert() 
     173        glue_distance, dummy = inverse.transform_distance(10, 0) 
    171174        glue_point = None 
    172175        glue_item = None 
  • gaphas/branches/hw/gaphas/view.py

    r1611 r1622  
    4747        self._dirty_matrix_items = set() 
    4848 
    49     matrix = property(lambda s: s._matrix) 
     49    matrix = property(lambda s: s._matrix, 
     50                      doc="Canvas to view transformation matrix") 
    5051 
    5152    def _set_canvas(self, canvas):