Changeset 984

Show
Ignore:
Timestamp:
08/26/06 05:09:18 (2 years ago)
Author:
arjanmol
Message:

keep upper-left of Element on (0, 0)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gaphas/trunk/ChangeLog

    r945 r984  
     12006-08-26  Arjan Molenaar  <arjan_at_yirdis_dot_nl> 
     2 
     3        * item.py: Element's upper left coordinate is always (0, 0), even after 
     4        a handle movement. 
     5 
    162006-07-17  Arjan Molenaar  <arjan_at_yirdis_dot_nl> 
    27 
  • gaphas/trunk/gaphas/item.py

    r978 r984  
    285285    def pre_update(self, context): 
    286286        """Make sure handles do not overlap during movement. 
    287         """ 
    288         pass 
     287        Make sure the first handle (normally NW) is located at (0, 0). 
     288        """ 
     289        h_nw = self._handles[0] 
     290        print h_nw.pos 
     291        x, y = h_nw.pos 
     292        if float(x) != 0.0: 
     293            self.matrix.translate(x, 0) 
     294            self._canvas.request_matrix_update(self) 
     295            for h in self._handles[1:]: 
     296                h.x -= x 
     297            h_nw.x = 0 
     298        if float(y) != 0.0: 
     299            self.matrix.translate(0, y) 
     300            self._canvas.request_matrix_update(self) 
     301            for h in self._handles[1:]: 
     302                h.y -= y 
     303            h_nw.y = 0 
    289304 
    290305    def update(self, context): 
    291         """Do nothing dureing update. 
     306        """Do nothing during update. 
    292307        """ 
    293308        pass