/* === 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
+** Copyright (c) 2007-2008 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$");
CurveGradient::CurveGradient():
- offset(0,0),
+ origin(0,0),
width(0.25),
gradient(Color::black(), Color::white()),
loop(false),
else
{
float t;
- Point point(point_-offset);
+ Point point(point_-origin);
std::vector<synfig::BLinePoint>::const_iterator iter,next;
const Real mag(diff.inv_mag());
supersample=supersample*mag;
diff*=mag*mag;
- dist=((point_-offset)*diff-p1*diff);
+ dist=((point_-origin)*diff-p1*diff);
}
}
else // not perpendicular
{
if (edge_case)
{
- diff=(p1-(point_-offset));
+ diff=(p1-(point_-origin));
if(diff*tangent.perp()<0) diff=-diff;
diff=diff.norm()*thickness*width;
}
const Real mag(diff.inv_mag());
supersample=supersample*mag;
diff*=mag*mag;
- dist=((point_-offset)*diff-p1*diff);
+ dist=((point_-origin)*diff-p1*diff);
}
if(loop)
{
- IMPORT(offset);
+ IMPORT(origin);
IMPORT(perpendicular);
IMPORT(fast);
IMPORT(gradient);
IMPORT(loop);
IMPORT(zigzag);
+
+ IMPORT_AS(origin,"offset");
+
return Layer_Composite::set_param(param,value);
}
ValueBase
CurveGradient::get_param(const String & param)const
{
- EXPORT(offset);
+ EXPORT(origin);
EXPORT(bline);
EXPORT(gradient);
EXPORT(loop);
{
Layer::Vocab ret(Layer_Composite::get_param_vocab());
- ret.push_back(ParamDesc("offset")
- .set_local_name(_("Offset")));
+ ret.push_back(ParamDesc("origin")
+ .set_local_name(_("Origin")));
ret.push_back(ParamDesc("width")
.set_is_distance()
ret.push_back(ParamDesc("bline")
.set_local_name(_("Vertices"))
- .set_origin("offset")
- .set_scalar("width")
+ .set_origin("origin")
+ .set_hint("width")
.set_description(_("A list of BLine Points")));
ret.push_back(ParamDesc("gradient")