The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – 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
[Tue, 25 Aug 2015 12:47:47 +0000]

Updated Files

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