Example #1
0
bool
Star::set_param(const String & param, const ValueBase &value)
{
	if(	param=="radius1" && value.same_type_as(radius1))
	{
		value.put(&radius1);
		sync();
		set_param_static(param, value.get_static());
		return true;
	}

	if(	param=="radius2" && value.same_type_as(radius2))
	{
		value.put(&radius2);
		sync();
		set_param_static(param, value.get_static());
		return true;
	}

	if(	param=="points" && value.same_type_as(points))
	{
		value.put(&points);
		if(points<2)points=2;
		sync();
		set_param_static(param, value.get_static());
		return true;
	}

	if(	param=="angle" && value.same_type_as(angle))
	{
		value.put(&angle);
		sync();
		set_param_static(param, value.get_static());
		return true;
	}

	if(param=="regular_polygon" && value.same_type_as(regular_polygon))
	{
		value.put(&regular_polygon);
		sync();
		set_param_static(param, value.get_static());
		return true;
	}

	if(param=="vector_list")
		return false;

	return Layer_Polygon::set_param(param,value);
}
Example #2
0
bool
Layer_PasteCanvas::set_param(const String & param, const ValueBase &value)
{
	IMPORT_VALUE(param_origin);
	IMPORT_VALUE(param_focus);

	// IMPORT(canvas);
	if(param=="canvas" && value.same_type_as(Canvas::Handle()))
	{
		set_sub_canvas(value.get(Canvas::Handle()));
		return true;
	}
	//! \todo this introduces bug 1844764 if enabled; it was introduced in r954.
	// http://synfig.org/images/3/3d/Moving-waypoints.sifz is an
	// example of an animation that has its waypoints displayed
	// incorrectly without this fix; select the outer layer and drag
	// the time slider.  The linear waypoints don't take effect until
	// 5s, but the time slider appears to pass the first one at 3s.
#if 0
	if (param=="time_offset" && value.same_type_as(time_offset))
	{
		if (time_offset != value.get(Time()))
		{
			value.put(&time_offset);
			// notify that the time_offset has changed so we can update the
			// waypoint positions in parent layers
			changed();
		}
		return true;
	}
#else
	IMPORT_VALUE(param_time_offset);
#endif

	IMPORT_VALUE(param_children_lock);
	IMPORT_VALUE(param_zoom);
	IMPORT_VALUE(param_outline_grow);
	IMPORT_VALUE(param_curr_time);
	IMPORT_VALUE(param_z_range);
	IMPORT_VALUE(param_z_range_position);
	IMPORT_VALUE(param_z_range_depth);
	IMPORT_VALUE(param_z_range_blur);
	return Layer_Composite::set_param(param,value);
}