Changeset 1114
- Timestamp:
- 01/01/07 14:11:38 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
gaphor/branches/new-canvas/gaphor/diagram/association.py
r1100 r1114 435 435 self._name_bounds = Rectangle() 436 436 self._mult_bounds = Rectangle() 437 self._point1 = self._point2 = (0, 0)438 437 439 438 self._subject = None … … 579 578 580 579 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 582 582 multiplicity label. p1 is the line end and p2 is the last 583 583 but one point of the line. … … 606 606 607 607 if abs_rc > 6: 608 # print 'horizontal line'608 # horizontal line 609 609 if h: 610 610 name_dx = ofs … … 618 618 mult_dy = ofs 619 619 elif 0 <= abs_rc <= 0.2: 620 # print 'vertical line'620 # vertical line 621 621 if v: 622 622 name_dx = -ofs - name_w … … 630 630 mult_dy = -ofs - mult_h 631 631 else: 632 # Should both items be placed on the same side of the line? 632 633 r = abs_rc < 1.0 634 635 # Find out alignment of text (depends on the direction of the line) 633 636 align_left = (h and not r) or (r and not h) 634 637 align_bottom = (v and not r) or (r and not v) … … 644 647 else: 645 648 name_dy = ofs 646 mult_dy = ofs + mult_h # + height649 mult_dy = ofs + mult_h 647 650 648 651 self._name_bounds = Rectangle(p1[0] + name_dx, … … 655 658 width=mult_w, 656 659 height=mult_h) 657 658 self._point1 = p1659 self._point2 = p2660 660 661 661 def on_subject_notify(self, pspec, notifiers=()): gaphor/branches/new-canvas/gaphor/diagram/flow.py
r1111 r1114 65 65 x = p1[0] > p2[0] and -10 or width + 10 66 66 x = p2[0] - x 67 y = p1[1] <= p2[1] and height + 15 or -1567 y = p1[1] <= p2[1] and height + 5 or -15 68 68 y = p2[1] - y 69 69 return x, y … … 94 94 95 95 96 def pre_update(self, context): 96 def update(self, context): 97 super(FlowItem, self).update(context) 97 98 self.update_name(context) 98 99 self.update_guard(context)
