/* === S Y N F I G ========================================================= */
/*! \file curvegradient.cpp
-** \brief Template Header
+** \brief Implementation of the "Curve Gradient" layer
**
** $Id$
**
** \legal
** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
+** Copyright (c) 2007 Chris Moore
**
** This package is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
SYNFIG_LAYER_INIT(CurveGradient);
SYNFIG_LAYER_SET_NAME(CurveGradient,"curve_gradient");
-SYNFIG_LAYER_SET_LOCAL_NAME(CurveGradient,_("Curve Gradient"));
-SYNFIG_LAYER_SET_CATEGORY(CurveGradient,_("Gradients"));
+SYNFIG_LAYER_SET_LOCAL_NAME(CurveGradient,N_("Curve Gradient"));
+SYNFIG_LAYER_SET_CATEGORY(CurveGradient,N_("Gradients"));
SYNFIG_LAYER_SET_VERSION(CurveGradient,"0.0");
SYNFIG_LAYER_SET_CVS_ID(CurveGradient,"$Id$");
#endif
}
-inline float calculate_distance(const std::vector<synfig::BLinePoint>& bline)
+inline float calculate_distance(const std::vector<synfig::BLinePoint>& bline, bool bline_loop)
{
std::vector<synfig::BLinePoint>::const_iterator iter,next,ret;
std::vector<synfig::BLinePoint>::const_iterator end(bline.end());
next=bline.begin();
- //if(loop)
- // iter=--bline.end();
- //else
- iter=next++;
+ if(bline_loop)
+ iter=--bline.end();
+ else
+ iter=next++;
for(;next!=end;iter=next++)
{
inline void
CurveGradient::sync()
{
- curve_length_=calculate_distance(bline);
+ curve_length_=calculate_distance(bline, bline_loop);
}
ret.push_back(ParamDesc("bline")
.set_local_name(_("Vertices"))
.set_origin("offset")
- .set_scalar("width")
+ .set_hint("width")
.set_description(_("A list of BLine Points")));
ret.push_back(ParamDesc("gradient")