The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

New key bindings

These changes was commited to the Birdfont repository Fri, 08 May 2015 18:02:37 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
[Fri, 08 May 2015 18:02:37 +0000]

Updated Files

birdfont/GtkWindow.vala
libbirdfont/BezierTool.vala
libbirdfont/Glyph.vala
resources/key_bindings.xml
--- a/birdfont/GtkWindow.vala +++ b/birdfont/GtkWindow.vala @@ -820,6 +820,8 @@ event_flags |= EventMask.SCROLL_MASK; add_events (event_flags); + + bool button_down = false; glyph_canvas.signal_redraw_area.connect ((x, y, w, h) => { queue_draw_area ((int)x, (int)y, (int)w, (int)h); @@ -854,6 +856,10 @@ button_press_event.connect ((t, e)=> { GtkWindow.reset_modifier (e.state); + if (button_down) { + warning (@"Button already is down. $(e.button)"); + } + if (e.time < last_press) { warning ("Discarding event."); return true; @@ -862,7 +868,8 @@ last_press = e.time; if (e.type == EventType.BUTTON_PRESS) { - TabContent.button_press (e.button, e.x, e.y); + TabContent.button_press (e.button, e.x, e.y); + button_down = true; } else if (e.type == EventType.2BUTTON_PRESS) { TabContent.double_click (e.button, e.x, e.y); } @@ -871,6 +878,10 @@ }); button_release_event.connect ((t, e)=> { + if (!button_down) { + warning (@"Button is not down $(e.button)"); + } + if (e.time < last_release) { warning ("Discarding event."); return true; @@ -879,6 +890,7 @@ if (e.type == EventType.BUTTON_RELEASE) { TabContent.button_release ((int) e.button, e.x, e.y); last_release = e.time; + button_down = false; } return true;
--- a/libbirdfont/BezierTool.vala +++ b/libbirdfont/BezierTool.vala @@ -151,14 +151,13 @@ state = MOVE_POINT; } else if (state == MOVE_POINT) { if (PenTool.can_join (current_point)) { - bool clockwise; + EditPoint first = current_path.get_first_point (); bool swap; - clockwise = current_path.is_clockwise (); p = PenTool.join_paths (current_point); - return_if_fail (p != null); path = (!) p; + swap = path.get_first_point () != first; if (current_path.points.size == 1) { return_if_fail (path.is_open ()); @@ -168,7 +167,6 @@ } else { g.open_path (); current_path = path; - swap = path.is_clockwise () != clockwise; current_point = !swap ? path.get_first_point () : path.get_last_point (); state = !swap ? MOVE_LAST_HANDLE_RIGHT : MOVE_LAST_HANDLE_LEFT; }
--- a/libbirdfont/Glyph.vala +++ b/libbirdfont/Glyph.vala @@ -1265,6 +1265,8 @@ open = false; clear_active_paths (); GlyphCanvas.redraw (); + + MainWindow.set_cursor (NativeWindow.VISIBLE); return r; }
--- a/resources/key_bindings.xml +++ b/resources/key_bindings.xml @@ -6,6 +6,7 @@ <action key="s" ctrl="true" alt="false" command="false" shift="false" action="save" /> <action key="S" ctrl="true" alt="false" command="false" shift="true" action="save as" /> <action key="e" ctrl="true" alt="false" command="false" shift="false" action="export" /> + <action key="" ctrl="false" alt="false" command="false" shift="false" action="export settings" /> <action key="p" ctrl="true" alt="false" command="false" shift="false" action="preview" /> <action key="" ctrl="false" alt="false" command="false" shift="false" action="select character set" /> <action key="" ctrl="false" alt="false" command="false" shift="false" action="quit" /> @@ -21,7 +22,7 @@ <action key="i" ctrl="true" alt="false" command="false" shift="false" action="import svg file" /> <action key="b" ctrl="true" alt="false" command="false" shift="false" action="import background image" /> <action key="" ctrl="false" alt="false" command="false" shift="false" action="simplify path" /> - <action key="c" ctrl="false" alt="false" command="false" shift="false" action="close path" /> + <action key="" ctrl="false" alt="false" command="false" shift="false" action="close path" /> <action key="" ctrl="false" alt="false" command="false" shift="false" action="glyph sequence" /> <action key="" ctrl="false" alt="false" command="false" shift="false" action="set background glyph" /> <action key="" ctrl="false" alt="false" command="false" shift="false" action="remove background glyph" /> @@ -48,8 +49,7 @@ <action key="" ctrl="false" alt="false" command="false" shift="false" action="save as .bfp" /> <action key="" ctrl="false" alt="false" command="false" shift="false" action="settings" /> <action key="d" ctrl="true" alt="false" command="false" shift="false" action="name and description" /> - <action key="b" ctrl="false" alt="false" command="false" shift="false" action="foresight" /> - <action key="s" ctrl="false" alt="false" command="false" shift="false" action="bezier_line" /> + <action key="b" ctrl="false" alt="false" command="false" shift="false" action="bezier_tool" /> <action key="n" ctrl="false" alt="false" command="false" shift="false" action="pen_tool" /> <action key="m" ctrl="false" alt="false" command="false" shift="false" action="point_tool" /> <action key="z" ctrl="false" alt="false" command="false" shift="false" action="zoom_tool" /> @@ -68,11 +68,11 @@ <action key="" ctrl="false" alt="false" command="false" shift="false" action="skew" /> <action key="" ctrl="false" alt="false" command="false" shift="false" action="width" /> <action key="" ctrl="false" alt="false" command="false" shift="false" action="height" /> - <action key="" ctrl="false" alt="false" command="false" shift="false" action="object_stroke" /> <action key="w" ctrl="false" alt="false" command="false" shift="false" action="tie_point" /> <action key="" ctrl="false" alt="false" command="false" shift="false" action="symmetric" /> <action key="" ctrl="false" alt="false" command="false" shift="false" action="create_line" /> <action key="" ctrl="false" alt="false" command="false" shift="false" action="reverse_path" /> + <action key="c" ctrl="false" alt="false" command="false" shift="false" action="close_path" /> <action key="" ctrl="false" alt="false" command="false" shift="false" action="move_layer" /> <action key="" ctrl="false" alt="false" command="false" shift="false" action="flip_vertical" /> <action key="" ctrl="false" alt="false" command="false" shift="false" action="flip_horizontal" /> @@ -86,6 +86,9 @@ <action key="" ctrl="false" alt="false" command="false" shift="false" action="auto_trace_simplify" /> <action key="" ctrl="false" alt="false" command="false" shift="false" action="autotrace" /> <action key="" ctrl="false" alt="false" command="false" shift="false" action="delete_background" /> + <action key="" ctrl="false" alt="false" command="false" shift="false" action="apply_stroke" /> + <action key="" ctrl="false" alt="false" command="false" shift="false" action="object_stroke" /> + <action key="" ctrl="false" alt="false" command="false" shift="false" action="stroke_to_outline" /> <action key="" ctrl="false" alt="false" command="false" shift="false" action="help_lines" /> <action key="" ctrl="false" alt="false" command="false" shift="false" action="show_xheight_helplines" /> <action key="" ctrl="false" alt="false" command="false" shift="false" action="background_help_lines" /> @@ -112,5 +115,6 @@ <action key="" ctrl="false" alt="false" command="false" shift="false" action="select_background" /> <action key="+" ctrl="true" alt="false" command="false" shift="false" action="zoom_in" /> <action key="-" ctrl="true" alt="false" command="false" shift="false" action="zoom_out" /> + <action key="s" ctrl="false" alt="false" command="false" shift="false" action="bezier_line" /> </bindings>