The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Toggle between right and left handle in Beziér tool

These changes was commited to the Birdfont repository Thu, 16 Oct 2014 13:17:01 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
author Johan Mattsson <johan.mattsson.m@gmail.com>
Thu, 16 Oct 2014 13:17:01 +0000 (15:17 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Thu, 16 Oct 2014 13:17:01 +0000 (15:17 +0200)
commit 203ec5668971aad2b798e12091407c1f0d8c1a5b
tree 7b780cdaec0da178ff36747c8db22ed2207dab60
parent 0343973617d2175e141dd6bf29a4295ac818e07b
Toggle between right and left handle in Beziér tool

libbirdfont/ForesightTool.vala
--- a/libbirdfont/ForesightTool.vala +++ b/libbirdfont/ForesightTool.vala @@ -28,6 +28,9 @@ uint state = NONE; bool move_right_handle = true; + + int last_x = 0; + int last_y = 0; public ForesightTool (string name) { base (name, t_ ("Create Beziér curves"), '.', CTRL); @@ -165,6 +168,8 @@ } } + last_x = x; + last_y = y; }); key_press_action.connect ((self, keyval) => { @@ -173,12 +178,11 @@ switch (keyval) { case 's': switch_to_line_mode (); - break; - case 'l': - move_right_handle = true; break; case 'r': - move_right_handle = false; + move_right_handle = !move_right_handle; + state = MOVE_HANDLES; + move_action (self, last_x, last_y); break; }