summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
675aca9)
inline void
CurveGradient::sync()
{
inline void
CurveGradient::sync()
{
- diff=(p2-p1);
- const Real mag(diff.inv_mag());
- diff*=mag*mag;
-
curve_length_=calculate_distance(bline);
}
CurveGradient::CurveGradient():
curve_length_=calculate_distance(bline);
}
CurveGradient::CurveGradient():
offset(0,0),
width(0.25),
gradient(Color::black(), Color::white()),
offset(0,0),
width(0.25),
gradient(Color::black(), Color::white()),
float
CurveGradient::calc_supersample(const synfig::Point &x, float pw,float ph)const
{
float
CurveGradient::calc_supersample(const synfig::Point &x, float pw,float ph)const
{
-// return pw/(p2-p1).mag();
bool
CurveGradient::set_param(const String & param, const ValueBase &value)
{
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);
{
EXPORT(offset);
EXPORT(bline);
{
EXPORT(offset);
EXPORT(bline);
- EXPORT(p1);
- EXPORT(p2);
EXPORT(gradient);
EXPORT(loop);
EXPORT(zigzag);
EXPORT(gradient);
EXPORT(loop);
EXPORT(zigzag);
private:
std::vector<synfig::BLinePoint> bline;
private:
std::vector<synfig::BLinePoint> bline;
Point offset;
Real width;
Point offset;
Real width;