diff options
author | matthias.vogelgesang <matthias.vogelgesang@8f060a39-251c-0410-b1f3-431655927647> | 2008-04-03 19:43:20 (GMT) |
---|---|---|
committer | matthias.vogelgesang <matthias.vogelgesang@8f060a39-251c-0410-b1f3-431655927647> | 2008-04-03 19:43:20 (GMT) |
commit | 18bfd5fb32746d8dcdb6567f108b3b5c30b69f6f (patch) | |
tree | 44ad625eec06d6d62c1234b9a5d7c064963bcf1a /src/Links.py | |
parent | 69673795798d0a6de8b43c15e18fa98c358947f3 (diff) |
* src/utils.py
* src/MainWindow.py
* src/BaseThought.py
* src/Links.py
* src/MMapArea.py
* data/labyrinth-ui.xml
Add bezier curves as stated in the ideas. It can be activated in the
edit menu.
git-svn-id: http://labyrinth.googlecode.com/svn/trunk@292 8f060a39-251c-0410-b1f3-431655927647
Diffstat (limited to 'src/Links.py')
-rw-r--r-- | src/Links.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/Links.py b/src/Links.py index 26b94e2..a1c81a9 100644 --- a/src/Links.py +++ b/src/Links.py @@ -123,14 +123,13 @@ class Link (gobject.GObject): context.set_line_width (self.strength) context.move_to (self.start[0], self.start[1]) - #dx = self.start[0] - self.end[0] - #dy = self.start[1] - self.end[1] - #x2 = self.end[0] + (dx * 2 / 3) - #y2 = self.end[1] + (dy / 3) - #x3 = self.end[0] + (dx / 3) - #y3 = self.end[1] + (dy * 2 / 3) - #context.curve_to(x2,y2, x3, y3, self.end[0], self.end[1]) - context.line_to (self.end[0], self.end[1]) + if utils.use_bezier_curves: + dx = self.end[0] - self.start[0] + x2 = self.start[0] + dx / 2.0 + x3 = self.end[0] - dx / 2.0 + context.curve_to(x2, self.start[1], x3, self.end[1], self.end[0], self.end[1]) + else: + context.line_to (self.end[0], self.end[1]) context.stroke () context.set_line_width (cwidth) |