X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Fsrc%2Fgui%2Fworkarearenderer%2Frenderer_ducks.cpp;h=c25995d9dad5256d2d9e775ba8255d241ce69b79;hb=b6831c4b32fb612908af87de6c01723c6a03e56f;hp=5ad88cb088374d1ecad75bd42f7c80521bdb522b;hpb=5db17dd500c44a59e62bc52cf1c22392edc972a8;p=synfig.git diff --git a/synfig-studio/src/gui/workarearenderer/renderer_ducks.cpp b/synfig-studio/src/gui/workarearenderer/renderer_ducks.cpp index 5ad88cb..c25995d 100644 --- a/synfig-studio/src/gui/workarearenderer/renderer_ducks.cpp +++ b/synfig-studio/src/gui/workarearenderer/renderer_ducks.cpp @@ -304,7 +304,39 @@ Renderer_Ducks::render_vfunc( if(!(*iter)->get_editable()) screen_duck.color=(DUCK_COLOR_NOT_EDITABLE); else if((*iter)->get_tangent()) - screen_duck.color=((*iter)->get_scalar()<0 ? DUCK_COLOR_TANGENT_1 : DUCK_COLOR_TANGENT_2); + if(0){ + // Tangents have different color depending on the split state (disabled for now) + // + // Check if we can reach the canvas and set the time to + // evaluate the split value accordingly + synfig::Canvas::Handle canvas_h(get_work_area()->get_canvas()); + synfig::Time time(canvas_h?canvas_h->get_time():synfig::Time(0)); + // Retrieve the split value of the bline point. + synfigapp::ValueDesc& v_d((*iter)->get_value_desc()); + synfig::LinkableValueNode::Handle parent; + if(v_d.parent_is_linkable_value_node()) + { + parent=v_d.get_parent_value_node(); + bool split; + synfig::ValueNode::Handle child(parent->get_link("split")); + if(synfig::ValueNode_Animated::Handle::cast_dynamic(child)) + { + synfig::ValueNode_Animated::Handle animated_child(synfig::ValueNode_Animated::Handle::cast_dynamic(child)); + split=animated_child->new_waypoint_at_time(time).get_value(time).get(split); + } + else if(synfig::ValueNode_Const::Handle::cast_dynamic(child)) + { + synfig::ValueNode_Const::Handle const_child(synfig::ValueNode_Const::Handle::cast_dynamic(child)); + split=(const_child->get_value()).get(split); + } + screen_duck.color=(split? DUCK_COLOR_TANGENT_2 : DUCK_COLOR_TANGENT_1); + } + else + screen_duck.color=DUCK_COLOR_TANGENT_1; + } else { + // All tangents are the same color + screen_duck.color=((*iter)->get_scalar()<0 ? DUCK_COLOR_TANGENT_1 : DUCK_COLOR_TANGENT_1); + } else if((*iter)->get_type()&Duck::TYPE_VERTEX) screen_duck.color=DUCK_COLOR_VERTEX; else if((*iter)->get_type()&Duck::TYPE_RADIUS)