inline void
CurveGradient::sync()
{
- diff=(p2-p1);
- const Real mag(diff.inv_mag());
- diff*=mag*mag;
-
curve_length_=calculate_distance(bline);
}
CurveGradient::CurveGradient():
- p1(1,1),
- p2(-1,-1),
offset(0,0),
width(0.25),
gradient(Color::black(), Color::white()),
float
CurveGradient::calc_supersample(const synfig::Point &x, float pw,float ph)const
{
-// return pw/(p2-p1).mag();
return pw;
}
bool
CurveGradient::set_param(const String & param, const ValueBase &value)
{
- if(param=="p1" && value.same_as(p1))
- {
- p1=value.get(p1);
- sync();
- return true;
- }
- if(param=="p2" && value.same_as(p2))
- {
- p2=value.get(p2);
- sync();
- return true;
- }
- //IMPORT(p1);
- //IMPORT(p2);
IMPORT(offset);
{
EXPORT(offset);
EXPORT(bline);
- EXPORT(p1);
- EXPORT(p2);
EXPORT(gradient);
EXPORT(loop);
EXPORT(zigzag);