Changeset 1114

Show
Ignore:
Timestamp:
01/01/07 14:11:38 (2 years ago)
Author:
arjanmol
Message:

fixed some make location issues with FlowItem?. updated AssociationItems? comments.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gaphor/branches/new-canvas/gaphor/diagram/association.py

    r1100 r1114  
    435435        self._name_bounds = Rectangle() 
    436436        self._mult_bounds = Rectangle() 
    437         self._point1 = self._point2 = (0, 0) 
    438437 
    439438        self._subject = None 
     
    579578 
    580579    def update(self, context, p1, p2): 
    581         """Update label placement for association's name and 
     580        """ 
     581        Update label placement for association's name and 
    582582        multiplicity label. p1 is the line end and p2 is the last 
    583583        but one point of the line. 
     
    606606 
    607607        if abs_rc > 6: 
    608             #print 'horizontal line' 
     608            # horizontal line 
    609609            if h: 
    610610                name_dx = ofs 
     
    618618                mult_dy = ofs 
    619619        elif 0 <= abs_rc <= 0.2: 
    620             #print 'vertical line' 
     620            # vertical line 
    621621            if v: 
    622622                name_dx = -ofs - name_w 
     
    630630                mult_dy = -ofs - mult_h 
    631631        else: 
     632            # Should both items be placed on the same side of the line? 
    632633            r = abs_rc < 1.0 
     634 
     635            # Find out alignment of text (depends on the direction of the line) 
    633636            align_left = (h and not r) or (r and not h) 
    634637            align_bottom = (v and not r) or (r and not v) 
     
    644647            else: 
    645648                name_dy = ofs  
    646                 mult_dy = ofs + mult_h # + height 
     649                mult_dy = ofs + mult_h 
    647650 
    648651        self._name_bounds = Rectangle(p1[0] + name_dx, 
     
    655658                                      width=mult_w, 
    656659                                      height=mult_h) 
    657  
    658         self._point1 = p1 
    659         self._point2 = p2 
    660660 
    661661    def on_subject_notify(self, pspec, notifiers=()): 
  • gaphor/branches/new-canvas/gaphor/diagram/flow.py

    r1111 r1114  
    6565            x = p1[0] > p2[0] and -10 or width + 10 
    6666            x = p2[0] - x 
    67             y = p1[1] <= p2[1] and height + 15 or -15 
     67            y = p1[1] <= p2[1] and height + 5 or -15 
    6868            y = p2[1] - y 
    6969            return x, y 
     
    9494 
    9595 
    96     def pre_update(self, context): 
     96    def update(self, context): 
     97        super(FlowItem, self).update(context) 
    9798        self.update_name(context) 
    9899        self.update_guard(context)