X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fstate_bline.cpp;h=a7ee7017ad2672ef91af6a6e55b229f6b9869e0a;hb=e80b4d10c19c3a890aae535facee1c934bea16ce;hp=51afafffaebaffd573c1e7d8df0bb1a0756d87d1;hpb=282b5162f219e2114a59a00743180b45c238680f;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/state_bline.cpp b/synfig-studio/trunk/src/gtkmm/state_bline.cpp index 51afaff..a7ee701 100644 --- a/synfig-studio/trunk/src/gtkmm/state_bline.cpp +++ b/synfig-studio/trunk/src/gtkmm/state_bline.cpp @@ -607,6 +607,13 @@ StateBLine_Context::run_() synfigapp::SelectionManager::LayerList layer_selection; + // count how many layers we're going to be creating + int layers_to_create = 0; + if (get_layer_curve_gradient_flag()) layers_to_create++; + if (get_layer_plant_flag()) layers_to_create++; + if (get_layer_region_flag()) layers_to_create++; + if (get_layer_outline_flag()) layers_to_create++; + /////////////////////////////////////////////////////////////////////////// // C U R V E G R A D I E N T /////////////////////////////////////////////////////////////////////////// @@ -642,7 +649,8 @@ StateBLine_Context::run_() } } - if (get_layer_link_offsets_flag()) + // only link the curve gradient's offset parameter if the option is selected and we're creating more than one layer + if (get_layer_link_offsets_flag() && layers_to_create > 1) { synfigapp::Action::Handle action(synfigapp::Action::create("layer_param_connect")); assert(action); @@ -700,8 +708,8 @@ StateBLine_Context::run_() } } - // plants don't have offsets? - if (get_layer_link_offsets_flag()) + // only link the plant's offset parameter if the option is selected and we're creating more than one layer + if (get_layer_link_offsets_flag() && layers_to_create > 1) { synfigapp::Action::Handle action(synfigapp::Action::create("layer_param_connect")); assert(action); @@ -770,7 +778,8 @@ StateBLine_Context::run_() } } - if (get_layer_link_offsets_flag()) + // only link the region's offset parameter if the option is selected and we're creating more than one layer + if (get_layer_link_offsets_flag() && layers_to_create > 1) { synfigapp::Action::Handle action(synfigapp::Action::create("layer_param_connect")); assert(action); @@ -833,7 +842,8 @@ StateBLine_Context::run_() } } - if (get_layer_link_offsets_flag()) + // only link the outline's offset parameter if the option is selected and we're creating more than one layer + if (get_layer_link_offsets_flag() && layers_to_create > 1) { synfigapp::Action::Handle action(synfigapp::Action::create("layer_param_connect")); assert(action); @@ -1306,11 +1316,7 @@ StateBLine_Context::bline_insert_vertex(synfig::ValueNode_Const::Handle value_no bline_point.set_vertex(curve(origin)); bline_point.set_width((next_bline_point.get_width()-prev_bline_point.get_width())*origin+prev_bline_point.get_width()); -#ifdef ETL_FIXED_DERIVATIVE bline_point.set_tangent1(deriv(origin)*std::min(1.0f-origin,origin)); -#else - bline_point.set_tangent1(-deriv(origin)*std::min(1.0f-origin,origin)); -#endif bline_point.set_tangent2(bline_point.get_tangent1()); bline_point.set_split_tangent_flag(false); bline_point.set_origin(origin);