The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Store autotrace settings

These changes was commited to the Birdfont repository Tue, 25 Aug 2015 12:47:47 +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>
Tue, 25 Aug 2015 12:47:47 +0000 (14:47 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Tue, 25 Aug 2015 12:47:47 +0000 (14:47 +0200)
commit b012a6f10043055fd4e3c5b0062629f6a226c0dd
tree 954f6193d49ab8183ab263e2cd0f61197e6fc99b
parent 7e1ea2db2242e99bf263b646469a8e86f82b7977
Store autotrace settings

libbirdfont/DrawingTools.vala
libbirdfont/MenuTab.vala
--- a/libbirdfont/DrawingTools.vala +++ b/libbirdfont/DrawingTools.vala @@ -735,6 +735,8 @@ b = (!) bg; b.update_background (); } + + BirdFont.get_current_font ().settings.set_setting ("autotrace_threshold", background_threshold.get_display_value ()); }); draw_tool_modifiers.add_tool (background_threshold); @@ -752,6 +754,8 @@ b = (!) bg; b.update_background (); } + + BirdFont.get_current_font ().settings.set_setting ("autotrace_resolution", auto_trace_resolution.get_display_value ()); }); draw_tool_modifiers.add_tool (auto_trace_resolution); @@ -761,6 +765,7 @@ auto_trace_simplify.show_icon (true); auto_trace_simplify.new_value_action.connect ((self) => { + BirdFont.get_current_font ().settings.set_setting ("autotrace_simplification", background_threshold.get_display_value ()); }); draw_tool_modifiers.add_tool (auto_trace_simplify);
--- a/libbirdfont/MenuTab.vala +++ b/libbirdfont/MenuTab.vala @@ -256,6 +256,24 @@ double so = double.parse (skew_overview); OverviewTools.skew.set_value_round (so); } + + string autotrace_resolution = f.settings.get_setting ("autotrace_resolution"); + if (autotrace_resolution != "") { + double ar = double.parse (autotrace_resolution); + DrawingTools.background_threshold.set_value_round (ar); + } + + string autotrace_threshold = f.settings.get_setting ("autotrace_threshold"); + if (autotrace_threshold != "") { + double at = double.parse (autotrace_threshold); + DrawingTools.auto_trace_resolution.set_value_round (at); + } + + string autotrace_simplification = f.settings.get_setting ("autotrace_simplification"); + if (autotrace_simplification != "") { + double asi = double.parse (autotrace_simplification); + DrawingTools.auto_trace_simplify.set_value_round (asi); + } } // FIXME: background thread