The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Add points only to one path in pen tool

These changes was commited to the Birdfont repository Sun, 03 May 2015 04:54:16 +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>
Sun, 03 May 2015 04:54:16 +0000 (06:54 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Sun, 03 May 2015 04:54:16 +0000 (06:54 +0200)
commit 4d2ee8dded54bd96144170f2c80cc1ca211d45bc
tree 975753b345afc6dbcdde2e3dea7f951b1f655fd5
parent bce6371684099f4d3818282fbef1e896476be31f
Add points only to one path in pen tool

libbirdfont/Glyph.vala
libbirdfont/PenTool.vala
resources/icons.bf
--- a/libbirdfont/Glyph.vala +++ b/libbirdfont/Glyph.vala @@ -190,6 +190,7 @@ if (!active_paths.contains (path)) { active_paths.add (path); } + PenTool.active_path = path; } } @@ -1121,6 +1122,7 @@ path_list.add (np); np.stroke = stroke ? StrokeTool.stroke_width : 0; add_active_path (np); + PenTool.active_path = np; } xt = path_coordinate_x (x); @@ -1128,8 +1130,8 @@ return_val_if_fail (active_paths.size > 0, new PointSelection.empty ()); - if (active_paths.get (active_paths.size - 1).is_open ()) { - np = active_paths.get (active_paths.size - 1); + if (PenTool.active_path.is_open ()) { + np = PenTool.active_path; np.add (xt, yt); } else { np = new Path (); @@ -1140,10 +1142,13 @@ if (DrawingTools.pen_tool.is_selected ()) { np.set_stroke (PenTool.path_stroke_width); } + + PenTool.active_path = np; } clear_active_paths (); add_active_path (np); + PenTool.active_path = np; inserted = np.points.get (np.points.size - 1);
--- a/libbirdfont/PenTool.vala +++ b/libbirdfont/PenTool.vala @@ -1436,7 +1436,6 @@ redraw = active_edit_point != e; active_edit_point = e; - active_path = path; if (e != null) { ((!)e).set_active (true); @@ -1741,10 +1740,6 @@ eh = get_closest_handle (event_x, event_y); eh.handle.active = true; active_handle = eh.handle; - active_path = eh.path; - - glyph.clear_active_paths (); - glyph.add_active_path (eh.path); } private void curve_corner_event (double event_x, double event_y) { @@ -1761,7 +1756,6 @@ p = get_closest_handle (event_x, event_y); selected_handle = p.handle; handle_selection = p; - active_path = p.path; selected_handle.selected = true; }
--- a/resources/icons.bf +++ b/resources/icons.bf @@ -215,11 +215,8 @@ <collection name="close_path"> <selected id="1"/> <glyph id="1" left="-28" right="28.419182948490214"> - <path stroke="0" skew="0" data="B 28.3602245702,27.4852661412 C 28.3602245702,11.9897661412 15.7036045702,-0.6668338588 0.2081145702,-0.6668338588 C -15.2873664298,-0.6668338588 -27.8309294298,11.9897661412 -27.8309294298,27.4852661412 C -27.8309294298,42.9807661412 -15.2873664298,55.5242661412 0.2081145702,55.5242661412 C 15.7036045702,55.5242661412 28.3602245702,42.9807661412 28.3602245702,27.4852661412" /> - <path stroke="0" skew="0" data="B -24.2129884298,27.4852661412 C -24.2129884298,13.9450661412 -13.3320824298,2.9510661412 0.2081145702,2.9510661412 C 13.7483145702,2.9510661412 24.7422845702,13.9450661412 24.7422845702,27.4852661412 C 24.7422845702,41.0254661412 13.7483145702,51.9063661412 0.2081145702,51.9063661412 C -13.3320824298,51.9063661412 -24.2129884298,41.0254661412 -24.2129884298,27.4852661412" /> - <path stroke="0" skew="0" data="S -1.9114391144,40.0000000000 L 2.0885608856,40.0000000000 D 2.0885608856,48.0000000000 2.0885608856,46.0000000000 2.0885608856,48.0000000000 L -1.9114391144,48.0000000000 L -1.9114391144,40.0000000000" /> - <path stroke="0" skew="0" data="S -1.9114391144,24.0000000000 L 2.0885608856,24.0000000000 L 2.0885608856,32.0000000000 L -1.9114391144,32.0000000000 L -1.9114391144,24.0000000000" /> - <path stroke="0" skew="0" data="S 2.0885608856,16.0000000000 L 2.0885608856,8.0000000000 L -1.9114391144,8.0000000000 L -1.9114391144,16.0000000000 L 2.0885608856,16.0000000000" /> + <path stroke="0" skew="0" data="B 20.9214399779,46.4584136463 C 25.5356012517,41.4669941322 28.3602245702,34.8055343550 28.3602245702,27.4852661412 C 28.3602245702,11.9897661412 15.7036045702,-0.6668338588 0.2081145702,-0.6668338588 C -15.2873664298,-0.6668338588 -27.8309294298,11.9897661412 -27.8309294298,27.4852661412 C -27.8309294298,42.9807661412 -15.2873664298,55.5242661412 0.2081145702,55.5242661412 C 3.9161033611,55.5242661412 7.4615328962,54.8060007661 10.7098756157,53.5008973888 M 8.4695959598,50.5641108168 C 5.5484427802,51.7822972390 3.5735978072,51.9063661412 0.2081145702,51.9063661412 C -13.3320824298,51.9063661412 -24.2129884298,41.0254661412 -24.2129884298,27.4852661412 C -24.2129884298,13.9450661412 -13.3320824298,2.9510661412 0.2081145702,2.9510661412 C 13.7483145702,2.9510661412 24.7422845702,13.9450661412 24.7422845702,27.4852661412 C 24.7422845702,34.0046216968 22.4676879584,39.4963754690 18.3132762610,43.8650615636 L 20.9214399779,46.4584136463" /> + <path stroke="0" skew="0" data="S 4.4537037037,45.0888888889 L 14.0462962963,58.9296296296 L 17.0611111111,57.2851851852 L 7.1944444444,43.4444444444 L 4.4537037037,45.0888888889" /> </glyph> </collection> <collection name="contrast_threshold"> @@ -1064,92 +1061,92 @@ <ligature sequence="i n s e r t _ g l y p h _ f r o m _ o v e r v i e w" replacement="insert_glyph_from_overview"/> <ligature sequence="h i g h _ c o n t r a s t _ b a c k g r o u n d" replacement="high_contrast_background"/> <ligature sequence="p r e v i o u s _ k e r n i n g _ s t r i n g" replacement="previous_kerning_string"/> + <ligature sequence="s h o w _ x h e i g h t _ h e l p l i n e s" replacement="show_xheight_helplines"/> <ligature sequence="g e n e r a t e _ h t m l _ d o c u m e n t" replacement="generate_html_document"/> - <ligature sequence="s h o w _ x h e i g h t _ h e l p l i n e s" replacement="show_xheight_helplines"/> + <ligature sequence="s h o w _ a l l _ l i n e _ h a n d l e s" replacement="show_all_line_handles"/> + <ligature sequence="b a c k g r o u n d _ h e l p _ l i n e s" replacement="background_help_lines"/> + <ligature sequence="a u t o _ t r a c e _ r e s o l u t i o n" replacement="auto_trace_resolution"/> + <ligature sequence="z o o m _ b a c k g r o u n d _ i m a g e" replacement="zoom_background_image"/> <ligature sequence="o r i e n t a t i o n _ c l o c k w i s e" replacement="orientation_clockwise"/> - <ligature sequence="z o o m _ b a c k g r o u n d _ i m a g e" replacement="zoom_background_image"/> - <ligature sequence="a u t o _ t r a c e _ r e s o l u t i o n" replacement="auto_trace_resolution"/> - <ligature sequence="b a c k g r o u n d _ h e l p _ l i n e s" replacement="background_help_lines"/> - <ligature sequence="s h o w _ a l l _ l i n e _ h a n d l e s" replacement="show_all_line_handles"/> + <ligature sequence="a u t o _ t r a c e _ s i m p l i f y" replacement="auto_trace_simplify"/> <ligature sequence="n e x t _ k e r n i n g _ s t r i n g" replacement="next_kerning_string"/> - <ligature sequence="a u t o _ t r a c e _ s i m p l i f y" replacement="auto_trace_simplify"/> - <ligature sequence="c o n t r a s t _ t h r e s h o l d" replacement="contrast_threshold"/> <ligature sequence="k e r n i n g _ t e x t _ i n p u t" replacement="kerning_text_input"/> + <ligature sequence="c o n t r a s t _ t h r e s h o l d" replacement="contrast_threshold"/> + <ligature sequence="o r i e n t a t i o n _ a r r o w" replacement="orientation_arrow"/> + <ligature sequence="d e l e t e _ b a c k g r o u n d" replacement="delete_background"/> + <ligature sequence="n e w _ p o i n t _ o n _ p a t h" replacement="new_point_on_path"/> + <ligature sequence="i n s e r t _ b a c k g r o u n d" replacement="insert_background"/> + <ligature sequence="s e l e c t _ b a c k g r o u n d" replacement="select_background"/> <ligature sequence="s t r o k e _ t o _ o u t l i n e" replacement="stroke_to_outline"/> - <ligature sequence="s e l e c t _ b a c k g r o u n d" replacement="select_background"/> - <ligature sequence="i n s e r t _ b a c k g r o u n d" replacement="insert_background"/> - <ligature sequence="n e w _ p o i n t _ o n _ p a t h" replacement="new_point_on_path"/> - <ligature sequence="d e l e t e _ b a c k g r o u n d" replacement="delete_background"/> - <ligature sequence="o r i e n t a t i o n _ a r r o w" replacement="orientation_arrow"/> - <ligature sequence="o r i e n t a t i o n _ b o t h" replacement="orientation_both"/> - <ligature sequence="q u a d r a t i c _ p o i n t s" replacement="quadratic_points"/> <ligature sequence="s c a l e _ b a c k g r o u n d" replacement="scale_background"/> - <ligature sequence="z o o m _ b o u n d a r i e s" replacement="zoom_boundaries"/> - <ligature sequence="s h o w _ b a c k g r o u n d" replacement="show_background"/> + <ligature sequence="q u a d r a t i c _ p o i n t s" replacement="quadratic_points"/> + <ligature sequence="o r i e n t a t i o n _ b o t h" replacement="orientation_both"/> + <ligature sequence="m o v e _ b a c k g r o u n d" replacement="move_background"/> <ligature sequence="f l i p _ h o r i z o n t a l" replacement="flip_horizontal"/> - <ligature sequence="m o v e _ b a c k g r o u n d" replacement="move_background"/> - <ligature sequence="f i l l _ o p e n _ p a t h" replacement="fill_open_path"/> - <ligature sequence="u p d a t e _ w e b v i e w" replacement="update_webview"/> - <ligature sequence="c u t _ b a c k g r o u n d" replacement="cut_background"/> + <ligature sequence="s h o w _ b a c k g r o u n d" replacement="show_background"/> + <ligature sequence="z o o m _ b o u n d a r i e s" replacement="zoom_boundaries"/> <ligature sequence="i n s e r t _ u n i c h a r" replacement="insert_unichar"/> - <ligature sequence="a d d _ n e w _ t h e m e" replacement="add_new_theme"/> - <ligature sequence="k e r n i n g _ c l a s s" replacement="kerning_class"/> - <ligature sequence="d o u b l e _ p o i n t s" replacement="double_points"/> - <ligature sequence="c o n v e r t _ p o i n t" replacement="convert_point"/> - <ligature sequence="d e l e t e _ b u t t o n" replacement="delete_button"/> - <ligature sequence="f l i p _ v e r t i c a l" replacement="flip_vertical"/> - <ligature sequence="d r o p d o w n _ m e n u" replacement="dropdown_menu"/> + <ligature sequence="c u t _ b a c k g r o u n d" replacement="cut_background"/> + <ligature sequence="u p d a t e _ w e b v i e w" replacement="update_webview"/> + <ligature sequence="f i l l _ o p e n _ p a t h" replacement="fill_open_path"/> <ligature sequence="r e s i z e _ h a n d l e" replacement="resize_handle"/> - <ligature sequence="a p p l y _ s t r o k e" replacement="apply_stroke"/> - <ligature sequence="e x p o r t _ f o n t s" replacement="export_fonts"/> - <ligature sequence="r e v e r s e _ p a t h" replacement="reverse_path"/> - <ligature sequence="c u b i c _ p o i n t s" replacement="cubic_points"/> - <ligature sequence="x _ c o o r d i n a t e" replacement="x_coordinate"/> + <ligature sequence="d r o p d o w n _ m e n u" replacement="dropdown_menu"/> + <ligature sequence="f l i p _ v e r t i c a l" replacement="flip_vertical"/> + <ligature sequence="d e l e t e _ b u t t o n" replacement="delete_button"/> + <ligature sequence="c o n v e r t _ p o i n t" replacement="convert_point"/> + <ligature sequence="d o u b l e _ p o i n t s" replacement="double_points"/> + <ligature sequence="k e r n i n g _ c l a s s" replacement="kerning_class"/> + <ligature sequence="a d d _ n e w _ t h e m e" replacement="add_new_theme"/> <ligature sequence="y _ c o o r d i n a t e" replacement="y_coordinate"/> - <ligature sequence="m o v e _ c a n v a s" replacement="move_canvas"/> - <ligature sequence="s p i n _ b u t t o n" replacement="spin_button"/> - <ligature sequence="c r e a t e _ l i n e" replacement="create_line"/> - <ligature sequence="b e z i e r _ l i n e" replacement="bezier_line"/> + <ligature sequence="x _ c o o r d i n a t e" replacement="x_coordinate"/> + <ligature sequence="c u b i c _ p o i n t s" replacement="cubic_points"/> + <ligature sequence="r e v e r s e _ p a t h" replacement="reverse_path"/> + <ligature sequence="e x p o r t _ f o n t s" replacement="export_fonts"/> + <ligature sequence="a p p l y _ s t r o k e" replacement="apply_stroke"/> <ligature sequence="r i g h t _ a r r o w" replacement="right_arrow"/> - <ligature sequence="f u l l _ g l y p h" replacement="full_glyph"/> - <ligature sequence="p o i n t _ t o o l" replacement="point_tool"/> - <ligature sequence="s e l e c t _ a l l" replacement="select_all"/> - <ligature sequence="m o v e _ l a y e r" replacement="move_layer"/> - <ligature sequence="h e l p _ l i n e s" replacement="help_lines"/> - <ligature sequence="l e f t _ a r r o w" replacement="left_arrow"/> + <ligature sequence="b e z i e r _ l i n e" replacement="bezier_line"/> + <ligature sequence="c r e a t e _ l i n e" replacement="create_line"/> + <ligature sequence="s p i n _ b u t t o n" replacement="spin_button"/> + <ligature sequence="m o v e _ c a n v a s" replacement="move_canvas"/> <ligature sequence="c l o s e _ p a t h" replacement="close_path"/> - <ligature sequence="o p e n _ f o n t" replacement="open_font"/> - <ligature sequence="m e n u _ i c o n" replacement="menu_icon"/> - <ligature sequence="t t f _ u n i t s" replacement="ttf_units"/> - <ligature sequence="r e c t a n g l e" replacement="rectangle"/> - <ligature sequence="z o o m _ t o o l" replacement="zoom_tool"/> - <ligature sequence="f o r e s i g h t" replacement="foresight"/> - <ligature sequence="s y m m e t r i c" replacement="symmetric"/> - <ligature sequence="t i e _ p o i n t" replacement="tie_point"/> - <ligature sequence="u n d o _ t o o l" replacement="undo_tool"/> - <ligature sequence="a u t o t r a c e" replacement="autotrace"/> - <ligature sequence="s h o w _ g r i d" replacement="show_grid"/> - <ligature sequence="i n f o _ i c o n" replacement="info_icon"/> + <ligature sequence="l e f t _ a r r o w" replacement="left_arrow"/> + <ligature sequence="h e l p _ l i n e s" replacement="help_lines"/> + <ligature sequence="m o v e _ l a y e r" replacement="move_layer"/> + <ligature sequence="s e l e c t _ a l l" replacement="select_all"/> + <ligature sequence="p o i n t _ t o o l" replacement="point_tool"/> + <ligature sequence="f u l l _ g l y p h" replacement="full_glyph"/> <ligature sequence="s a v e _ f o n t" replacement="save_font"/> - <ligature sequence="n e w _ f o n t" replacement="new_font"/> - <ligature sequence="p r o g r e s s" replacement="progress"/> - <ligature sequence="z o o m _ 1 _ 1" replacement="zoom_1_1"/> - <ligature sequence="p e n _ t o o l" replacement="pen_tool"/> - <ligature sequence="r o t a t i o n" replacement="rotation"/> - <ligature sequence="z o o m _ o u t" replacement="zoom_out"/> + <ligature sequence="i n f o _ i c o n" replacement="info_icon"/> + <ligature sequence="s h o w _ g r i d" replacement="show_grid"/> + <ligature sequence="a u t o t r a c e" replacement="autotrace"/> + <ligature sequence="u n d o _ t o o l" replacement="undo_tool"/> + <ligature sequence="t i e _ p o i n t" replacement="tie_point"/> + <ligature sequence="s y m m e t r i c" replacement="symmetric"/> + <ligature sequence="f o r e s i g h t" replacement="foresight"/> + <ligature sequence="z o o m _ t o o l" replacement="zoom_tool"/> + <ligature sequence="r e c t a n g l e" replacement="rectangle"/> + <ligature sequence="t t f _ u n i t s" replacement="ttf_units"/> + <ligature sequence="m e n u _ i c o n" replacement="menu_icon"/> + <ligature sequence="o p e n _ f o n t" replacement="open_font"/> <ligature sequence="s e t t i n g s" replacement="settings"/> + <ligature sequence="z o o m _ o u t" replacement="zoom_out"/> + <ligature sequence="r o t a t i o n" replacement="rotation"/> + <ligature sequence="p e n _ t o o l" replacement="pen_tool"/> + <ligature sequence="z o o m _ 1 _ 1" replacement="zoom_1_1"/> + <ligature sequence="p r o g r e s s" replacement="progress"/> + <ligature sequence="n e w _ f o n t" replacement="new_font"/> <ligature sequence="z o o m _ i n" replacement="zoom_in"/> - <ligature sequence="c i r c l e" replacement="circle"/> - <ligature sequence="r e s i z e" replacement="resize"/> <ligature sequence="h e i g h t" replacement="height"/> - <ligature sequence="t r a c k" replacement="track"/> - <ligature sequence="w i d t h" replacement="width"/> + <ligature sequence="r e s i z e" replacement="resize"/> + <ligature sequence="c i r c l e" replacement="circle"/> <ligature sequence="t h e m e" replacement="theme"/> - <ligature sequence="n e x t" replacement="next"/> - <ligature sequence="p r e v" replacement="prev"/> - <ligature sequence="m o v e" replacement="move"/> + <ligature sequence="w i d t h" replacement="width"/> + <ligature sequence="t r a c k" replacement="track"/> <ligature sequence="s k e w" replacement="skew"/> + <ligature sequence="m o v e" replacement="move"/> + <ligature sequence="p r e v" replacement="prev"/> + <ligature sequence="n e x t" replacement="next"/> <kerning left="settings" right="l" hadjustment="3.8289794922" /> </font>