size(0.1,0.1),
type(Blur::FASTGAUSSIAN),
color(Color::black()),
- offset(0.2,-0.2),
+ origin(0.2,-0.2),
invert(false)
{
}
IMPORT_PLUS(color, { if (color.get_a() == 0) { if (converted_blend_) {
set_blend_method(Color::BLEND_ALPHA_OVER);
color.set_a(1); } else transparent_color_ = true; } });
- IMPORT(offset);
+ IMPORT(origin);
IMPORT(invert);
+ IMPORT_AS(origin,"offset");
+
return Layer_Composite::set_param(param,value);
}
EXPORT(size);
EXPORT(type);
EXPORT(color);
- EXPORT(offset);
+ EXPORT(origin);
EXPORT(invert);
EXPORT_NAME();
Color shade(color);
if(!invert)
- shade.set_a(context.get_color(blurpos-offset).get_a());
+ shade.set_a(context.get_color(blurpos-origin).get_a());
else
- shade.set_a(1.0f-context.get_color(blurpos-offset).get_a());
+ shade.set_a(1.0f-context.get_color(blurpos-origin).get_a());
return Color::blend(shade,context.get_color(pos),get_amount(),get_blend_method());
}
int halfsizex = (int) (abs(size[0]*.5/pw) + 3),
halfsizey = (int) (abs(size[1]*.5/ph) + 3);
- int offset_u(-round_to_int(offset[0]/pw)),offset_v(-round_to_int(offset[1]/ph));
+ int origin_u(-round_to_int(origin[0]/pw)),origin_v(-round_to_int(origin[1]/ph));
- int offset_w(w+abs(offset_u)),offset_h(h+abs(offset_v));
+ int origin_w(w+abs(origin_u)),origin_h(h+abs(origin_v));
workdesc.set_subwindow(
- offset_u<0?offset_u:0,
- offset_v<0?offset_v:0,
- (offset_u>0?offset_u:0)+w,
- (offset_v>0?offset_v:0)+h
+ origin_u<0?origin_u:0,
+ origin_v<0?origin_v:0,
+ (origin_u>0?origin_u:0)+w,
+ (origin_v>0?origin_v:0)+h
);
if(quality >= 10)
case Blur::BOX:
case Blur::CROSS:
{
- workdesc.set_subwindow(-max(1,halfsizex),-max(1,halfsizey),offset_w+2*max(1,halfsizex),offset_h+2*max(1,halfsizey));
+ workdesc.set_subwindow(-max(1,halfsizex),-max(1,halfsizey),origin_w+2*max(1,halfsizex),origin_h+2*max(1,halfsizey));
break;
}
case Blur::FASTGAUSSIAN:
halfsizex*=2;
halfsizey*=2;
}
- workdesc.set_subwindow(-max(1,halfsizex),-max(1,halfsizey),offset_w+2*max(1,halfsizex),offset_h+2*max(1,halfsizey));
+ workdesc.set_subwindow(-max(1,halfsizex),-max(1,halfsizey),origin_w+2*max(1,halfsizex),origin_h+2*max(1,halfsizey));
break;
}
case Blur::GAUSSIAN:
halfsizex = (halfsizex + 1)/2;
halfsizey = (halfsizey + 1)/2;
- workdesc.set_subwindow( -halfsizex, -halfsizey, offset_w+2*halfsizex, offset_h+2*halfsizey );
+ workdesc.set_subwindow( -halfsizex, -halfsizey, origin_w+2*halfsizex, origin_h+2*halfsizey );
break;
}
//be sure the surface is of the correct size
surface->set_wh(renddesc.get_w(),renddesc.get_h());
- int u = halfsizex-(offset_u<0?offset_u:0), v = halfsizey-(offset_v<0?offset_v:0);
+ int u = halfsizex-(origin_u<0?origin_u:0), v = halfsizey-(origin_v<0?origin_v:0);
for(y=0;y<renddesc.get_h();y++,v++)
{
- u = halfsizex-(offset_u<0?offset_u:0);
+ u = halfsizex-(origin_u<0?origin_u:0);
for(x=0;x<renddesc.get_w();x++,u++)
{
Color a(color);
if(!invert)
- a.set_a(blurred.linear_sample(offset_u+(float)u,offset_v+(float)v));
+ a.set_a(blurred.linear_sample(origin_u+(float)u,origin_v+(float)v));
else
- a.set_a(1.0f-blurred.linear_sample(offset_u+(float)u,offset_v+(float)v));
+ a.set_a(1.0f-blurred.linear_sample(origin_u+(float)u,origin_v+(float)v));
if(a.get_a() || get_blend_method()==Color::BLEND_STRAIGHT)
{
Blur(size,type,&stagetwo)(blurred,workdesc.get_br()-workdesc.get_tl(),blurred);
- int u = halfsizex-(offset_u<0?offset_u:0), v = halfsizey-(offset_v<0?offset_v:0);
+ int u = halfsizex-(origin_u<0?origin_u:0), v = halfsizey-(origin_v<0?origin_v:0);
for(y=0;y<renddesc.get_h();y++,v++)
{
- u = halfsizex-(offset_u<0?offset_u:0);
+ u = halfsizex-(origin_u<0?origin_u:0);
for(x=0;x<renddesc.get_w();x++,u++)
{
Color a(color);
if(!invert)
- a.set_a(blurred.linear_sample(((float)offset_u+(float)u)/(float)fw,((float)offset_v+(float)v)/(float)fh));
+ a.set_a(blurred.linear_sample(((float)origin_u+(float)u)/(float)fw,((float)origin_v+(float)v)/(float)fh));
else
- a.set_a(1.0f-blurred.linear_sample(((float)offset_u+(float)u)/fw,((float)offset_v+(float)v)/(float)fh));
+ a.set_a(1.0f-blurred.linear_sample(((float)origin_u+(float)u)/fw,((float)origin_v+(float)v)/(float)fh));
if(a.get_a() || get_blend_method()==Color::BLEND_STRAIGHT)
{
ret.push_back(ParamDesc("color")
.set_local_name(_("Color"))
);
- ret.push_back(ParamDesc("offset")
- .set_local_name(_("Offset"))
+ ret.push_back(ParamDesc("origin")
+ .set_local_name(_("Origin"))
);
ret.push_back(ParamDesc("size")
.set_local_name(_("Size"))
.set_description(_("Size of Shade"))
.set_is_distance()
- .set_origin("offset")
+ .set_origin("origin")
);
ret.push_back(ParamDesc("type")
.set_local_name(_("Type"))
if(Color::is_onto(get_blend_method()))
return under;
- Rect bounds((under+offset).expand_x(size[0]).expand_y(size[1]));
+ Rect bounds((under+origin).expand_x(size[0]).expand_y(size[1]));
if(is_solid_color())
return bounds;
synfig::Vector size;
int type;
synfig::Color color;
- synfig::Vector offset;
+ synfig::Vector origin;
bool invert;
public:
float radius1;
float radius2;
- point-=offset;
+ point-=origin;
{
const float a(Angle::sin(-angle).get()), b(Angle::cos(-angle).get());
public:
int type;
- synfig::Point offset;
+ synfig::Point origin;
synfig::Vector size;
synfig::Angle angle;
color_dark(Color::black()),
color_light(Color::white())
{
- halftone.offset=(synfig::Point(0,0));
+ halftone.origin=(synfig::Point(0,0));
halftone.size=(synfig::Vector(0.25,0.25));
halftone.angle=(Angle::zero());
halftone.type=TYPE_SYMMETRIC;
IMPORT_AS(halftone.size,"size");
IMPORT_AS(halftone.type,"type");
IMPORT_AS(halftone.angle,"angle");
- IMPORT_AS(halftone.offset,"offset");
+ IMPORT_AS(halftone.origin,"origin");
+
+ IMPORT_AS(halftone.origin,"offset");
return Layer_Composite::set_param(param,value);
}
EXPORT_AS(halftone.size,"size");
EXPORT_AS(halftone.type,"type");
EXPORT_AS(halftone.angle,"angle");
- EXPORT_AS(halftone.offset,"offset");
+ EXPORT_AS(halftone.origin,"origin");
EXPORT(color_dark);
EXPORT(color_light);
{
Layer::Vocab ret(Layer_Composite::get_param_vocab());
- ret.push_back(ParamDesc("offset")
- .set_local_name(_("Mask Offset"))
+ ret.push_back(ParamDesc("origin")
+ .set_local_name(_("Mask Origin"))
.set_is_distance()
);
ret.push_back(ParamDesc("angle")
.set_local_name(_("Mask Angle"))
- .set_origin("offset")
+ .set_origin("origin")
);
ret.push_back(ParamDesc("size")
.set_local_name(_("Mask Size"))
.set_is_distance()
- .set_origin("offset")
+ .set_origin("origin")
);
ret.push_back(ParamDesc("color_light")
.set_local_name(_("Light Color"))
{
tone[i].size=size;
tone[i].type=type;
- tone[i].offset=(synfig::Point(0,0));
+ tone[i].origin=(synfig::Point(0,0));
tone[i].angle=Angle::deg(30.0)*(float)i;
}
IMPORT_PLUS(subtractive,sync());
IMPORT(tone[0].angle);
- IMPORT(tone[0].offset);
+ IMPORT(tone[0].origin);
IMPORT(tone[1].angle);
- IMPORT(tone[1].offset);
+ IMPORT(tone[1].origin);
IMPORT(tone[2].angle);
- IMPORT(tone[2].offset);
+ IMPORT(tone[2].origin);
+
+ IMPORT_AS(tone[0].origin,"tone[0].offset");
+ IMPORT_AS(tone[1].origin,"tone[1].offset");
+ IMPORT_AS(tone[2].origin,"tone[2].offset");
return Layer_Composite::set_param(param,value);
}
EXPORT(subtractive);
EXPORT(tone[0].angle);
- EXPORT(tone[0].offset);
+ EXPORT(tone[0].origin);
EXPORT(tone[1].angle);
- EXPORT(tone[1].offset);
+ EXPORT(tone[1].origin);
EXPORT(tone[2].angle);
- EXPORT(tone[2].offset);
+ EXPORT(tone[2].origin);
EXPORT_NAME();
EXPORT_VERSION();
.set_local_name(chan_name+_(" Color"))
);
- ret.push_back(ParamDesc(strprintf("tone[%d].offset",i))
- .set_local_name(chan_name+_(" Mask Offset"))
+ ret.push_back(ParamDesc(strprintf("tone[%d].origin",i))
+ .set_local_name(chan_name+_(" Mask Origin"))
.set_is_distance()
);
ret.push_back(ParamDesc(strprintf("tone[%d].angle",i))
.set_local_name(chan_name+_(" Mask Angle"))
- .set_origin(strprintf("tone[%d].offset",i))
+ .set_origin(strprintf("tone[%d].origin",i))
);
}
ret.push_back(ParamDesc("bline")
.set_local_name(_("Vertices"))
- .set_origin("offset")
+ .set_origin("origin")
.set_hint("width")
.set_description(_("A list of BLine Points"))
);
ret.push_back(ParamDesc("bline")
.set_local_name(_("Vertices"))
- .set_origin("offset")
+ .set_origin("origin")
);
return ret;
.set_local_name(_("Outer Radius"))
.set_description(_("The radius of the outer points in the star"))
.set_is_distance()
- .set_origin("offset")
+ .set_origin("origin")
);
ret.push_back(ParamDesc("radius2")
.set_local_name(_("Inner Radius"))
.set_description(_("The radius of the inner points in the star"))
.set_is_distance()
- .set_origin("offset")
+ .set_origin("origin")
);
ret.push_back(ParamDesc("angle")
.set_local_name(_("Angle"))
.set_description(_("The orientation of the star"))
- .set_origin("offset")
+ .set_origin("origin")
);
ret.push_back(ParamDesc("points")
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_origin("origin")
.set_hint("width")
.set_description(_("A list of BLine Points")));
private:
std::vector<synfig::BLinePoint> bline;
- Point offset;
+ Point origin;
Real width;
Gradient gradient;
Real curve_length_;
Plant::Plant():
- offset(0,0),
+ origin(0,0),
split_angle(Angle::deg(10)),
gravity(0,-0.1),
velocity(0.3),
needs_sync_=true;
return true;
}
- IMPORT(offset);
+ IMPORT(origin);
IMPORT_PLUS(split_angle,needs_sync_=true);
IMPORT_PLUS(gravity,needs_sync_=true);
IMPORT_PLUS(gradient,needs_sync_=true);
IMPORT(size_as_alpha);
IMPORT(reverse);
+ IMPORT_AS(origin,"offset");
+
return Layer_Composite::set_param(param,value);
}
/*
if(param=="seed")
return random.get_seed();
EXPORT(bline);
- EXPORT(offset);
+ EXPORT(origin);
EXPORT(split_angle);
EXPORT(gravity);
EXPORT(velocity);
ret.push_back(ParamDesc("bline")
.set_local_name(_("Vertices"))
.set_description(_("A list of BLine Points"))
- .set_origin("offset")
+ .set_origin("origin")
.set_hint("width")
);
- ret.push_back(ParamDesc("offset")
- .set_local_name(_("Offset"))
+ ret.push_back(ParamDesc("origin")
+ .set_local_name(_("Origin"))
);
ret.push_back(ParamDesc("gradient")
dest_surface.set_wh(surface->get_w(),surface->get_h());
dest_surface.clear();
- const Point tl(renddesc.get_tl()-offset);
- const Point br(renddesc.get_br()-offset);
+ const Point tl(renddesc.get_tl()-origin);
+ const Point br(renddesc.get_br()-origin);
const int w(renddesc.get_w());
const int h(renddesc.get_h());
std::vector<synfig::BLinePoint> bline;
bool bline_loop;
- Point offset;
+ Point origin;
synfig::Gradient gradient;
ret.push_back(ParamDesc("vector_list")
.set_local_name(_("Vector List"))
- .set_origin("offset")
+ .set_origin("origin")
);
return ret;
Layer_Composite (a,m),
edge_table (new Intersector),
color (Color::black()),
- offset (0,0),
+ origin (0,0),
invert (false),
antialias (true),
blurtype (Blur::FASTGAUSSIAN),
IMPORT_PLUS(color, { if (color.get_a() == 0) { if (converted_blend_) {
set_blend_method(Color::BLEND_ALPHA_OVER);
color.set_a(1); } else transparent_color_ = true; } });
- IMPORT(offset);
+ IMPORT(origin);
IMPORT(invert);
IMPORT(antialias);
IMPORT_PLUS(feather, if(feather<0)feather=0;);
IMPORT(blurtype);
IMPORT(winding_style);
+ IMPORT_AS(origin,"offset");
+
return Layer_Composite::set_param(param,value);
}
Layer_Shape::get_param(const String ¶m)const
{
EXPORT(color);
- EXPORT(offset);
+ EXPORT(origin);
EXPORT(invert);
EXPORT(antialias);
EXPORT(feather);
.set_local_name(_("Color"))
.set_description(_("Layer_Shape Color"))
);
- ret.push_back(ParamDesc("offset")
- .set_local_name(_("Offset"))
+ ret.push_back(ParamDesc("origin")
+ .set_local_name(_("Origin"))
);
ret.push_back(ParamDesc("invert")
.set_local_name(_("Invert"))
synfig::Layer::Handle
Layer_Shape::hit_check(synfig::Context context, const synfig::Point &p)const
{
- Point pos(p-offset);
+ Point pos(p-origin);
int intercepts = edge_table->intersect(pos[0],pos[1]);
if(feather)
pp = Blur(feather,feather,blurtype)(p);
- Point pos(pp-offset);
+ Point pos(pp-origin);
int intercepts = edge_table->intersect(pos[0],pos[1]);
if(is_solid_color() && invert)
{
Rect aabb = edge_table->aabb;
- Point tl = renddesc.get_tl() - offset;
+ Point tl = renddesc.get_tl() - origin;
Real pw = renddesc.get_pw(),
ph = renddesc.get_ph();
case Primitive::MOVE_TO:
{
x = data[curnum][0];
- x = (x - tl[0] + offset[0])*pw;
+ x = (x - tl[0] + origin[0])*pw;
y = data[curnum][1];
- y = (y - tl[1] + offset[1])*ph;
+ y = (y - tl[1] + origin[1])*ph;
if(curnum == 0)
{
case Primitive::LINE_TO:
{
x = data[curnum][0];
- x = (x - tl[0] + offset[0])*pw;
+ x = (x - tl[0] + origin[0])*pw;
y = data[curnum][1];
- y = (y - tl[1] + offset[1])*ph;
+ y = (y - tl[1] + origin[1])*ph;
tangent[0] = x - span.cur_x;
tangent[1] = y - span.cur_y;
case Primitive::CONIC_TO:
{
x = data[curnum+1][0];
- x = (x - tl[0] + offset[0])*pw;
+ x = (x - tl[0] + origin[0])*pw;
y = data[curnum+1][1];
- y = (y - tl[1] + offset[1])*ph;
+ y = (y - tl[1] + origin[1])*ph;
x1 = data[curnum][0];
- x1 = (x1 - tl[0] + offset[0])*pw;
+ x1 = (x1 - tl[0] + origin[0])*pw;
y1 = data[curnum][1];
- y1 = (y1 - tl[1] + offset[1])*ph;
+ y1 = (y1 - tl[1] + origin[1])*ph;
tangent[0] = 2*(x - x1);
tangent[1] = 2*(y - y1);
case Primitive::CONIC_TO_SMOOTH:
{
x = data[curnum][0];
- x = (x - tl[0] + offset[0])*pw;
+ x = (x - tl[0] + origin[0])*pw;
y = data[curnum][1];
- y = (y - tl[1] + offset[1])*ph;
+ y = (y - tl[1] + origin[1])*ph;
x1 = span.cur_x + tangent[0]/2;
y1 = span.cur_y + tangent[1]/2;
case Primitive::CUBIC_TO:
{
x = data[curnum+2][0];
- x = (x - tl[0] + offset[0])*pw;
+ x = (x - tl[0] + origin[0])*pw;
y = data[curnum+2][1];
- y = (y - tl[1] + offset[1])*ph;
+ y = (y - tl[1] + origin[1])*ph;
x2 = data[curnum+1][0];
- x2 = (x2 - tl[0] + offset[0])*pw;
+ x2 = (x2 - tl[0] + origin[0])*pw;
y2 = data[curnum+1][1];
- y2 = (y2 - tl[1] + offset[1])*ph;
+ y2 = (y2 - tl[1] + origin[1])*ph;
x1 = data[curnum][0];
- x1 = (x1 - tl[0] + offset[0])*pw;
+ x1 = (x1 - tl[0] + origin[0])*pw;
y1 = data[curnum][1];
- y1 = (y1 - tl[1] + offset[1])*ph;
+ y1 = (y1 - tl[1] + origin[1])*ph;
tangent[0] = 2*(x - x2);
tangent[1] = 2*(y - y2);
case Primitive::CUBIC_TO_SMOOTH:
{
x = data[curnum+1][0];
- x = (x - tl[0] + offset[0])*pw;
+ x = (x - tl[0] + origin[0])*pw;
y = data[curnum+1][1];
- y = (y - tl[1] + offset[1])*ph;
+ y = (y - tl[1] + origin[1])*ph;
x2 = data[curnum][0];
- x2 = (x2 - tl[0] + offset[0])*pw;
+ x2 = (x2 - tl[0] + origin[0])*pw;
y2 = data[curnum][1];
- y2 = (y2 - tl[1] + offset[1])*ph;
+ y2 = (y2 - tl[1] + origin[1])*ph;
x1 = span.cur_x + tangent[0]/3.0;
y1 = span.cur_y + tangent[1]/3.0;
case Primitive::MOVE_TO:
{
x = data[curnum][0];
- x = (x - tl[0] + offset[0])*pw;
+ x = (x - tl[0] + origin[0])*pw;
y = data[curnum][1];
- y = (y - tl[1] + offset[1])*ph;
+ y = (y - tl[1] + origin[1])*ph;
if(curnum == 0)
{
case Primitive::LINE_TO:
{
x = data[curnum][0];
- x = (x - tl[0] + offset[0])*pw;
+ x = (x - tl[0] + origin[0])*pw;
y = data[curnum][1];
- y = (y - tl[1] + offset[1])*ph;
+ y = (y - tl[1] + origin[1])*ph;
tangent[0] = x - span.cur_x;
tangent[1] = y - span.cur_y;
case Primitive::CONIC_TO:
{
x = data[curnum+1][0];
- x = (x - tl[0] + offset[0])*pw;
+ x = (x - tl[0] + origin[0])*pw;
y = data[curnum+1][1];
- y = (y - tl[1] + offset[1])*ph;
+ y = (y - tl[1] + origin[1])*ph;
x1 = data[curnum][0];
- x1 = (x1 - tl[0] + offset[0])*pw;
+ x1 = (x1 - tl[0] + origin[0])*pw;
y1 = data[curnum][1];
- y1 = (y1 - tl[1] + offset[1])*ph;
+ y1 = (y1 - tl[1] + origin[1])*ph;
tangent[0] = 2*(x - x1);
tangent[1] = 2*(y - y1);
case Primitive::CONIC_TO_SMOOTH:
{
x = data[curnum][0];
- x = (x - tl[0] + offset[0])*pw;
+ x = (x - tl[0] + origin[0])*pw;
y = data[curnum][1];
- y = (y - tl[1] + offset[1])*ph;
+ y = (y - tl[1] + origin[1])*ph;
x1 = span.cur_x + tangent[0]/2;
y1 = span.cur_y + tangent[1]/2;
case Primitive::CUBIC_TO:
{
x = data[curnum+2][0];
- x = (x - tl[0] + offset[0])*pw;
+ x = (x - tl[0] + origin[0])*pw;
y = data[curnum+2][1];
- y = (y - tl[1] + offset[1])*ph;
+ y = (y - tl[1] + origin[1])*ph;
x2 = data[curnum+1][0];
- x2 = (x2 - tl[0] + offset[0])*pw;
+ x2 = (x2 - tl[0] + origin[0])*pw;
y2 = data[curnum+1][1];
- y2 = (y2 - tl[1] + offset[1])*ph;
+ y2 = (y2 - tl[1] + origin[1])*ph;
x1 = data[curnum][0];
- x1 = (x1 - tl[0] + offset[0])*pw;
+ x1 = (x1 - tl[0] + origin[0])*pw;
y1 = data[curnum][1];
- y1 = (y1 - tl[1] + offset[1])*ph;
+ y1 = (y1 - tl[1] + origin[1])*ph;
tangent[0] = 2*(x - x2);
tangent[1] = 2*(y - y2);
case Primitive::CUBIC_TO_SMOOTH:
{
x = data[curnum+1][0];
- x = (x - tl[0] + offset[0])*pw;
+ x = (x - tl[0] + origin[0])*pw;
y = data[curnum+1][1];
- y = (y - tl[1] + offset[1])*ph;
+ y = (y - tl[1] + origin[1])*ph;
x2 = data[curnum][0];
- x2 = (x2 - tl[0] + offset[0])*pw;
+ x2 = (x2 - tl[0] + origin[0])*pw;
y2 = data[curnum][1];
- y2 = (y2 - tl[1] + offset[1])*ph;
+ y2 = (y2 - tl[1] + origin[1])*ph;
x1 = span.cur_x + tangent[0]/3.0;
y1 = span.cur_y + tangent[1]/3.0;
if (edge_table->initaabb)
return Rect::zero();
- Rect bounds(edge_table->aabb+offset);
+ Rect bounds(edge_table->aabb+origin);
bounds.expand(max((bounds.get_min() - bounds.get_max()).mag()*0.01,
feather));
//exported data
Color color;
- Point offset;
+ Point origin;
bool invert;
bool antialias;
Gtk::CheckButton checkbutton_layer_outline;
Gtk::CheckButton checkbutton_layer_curve_gradient;
Gtk::CheckButton checkbutton_layer_plant;
- Gtk::CheckButton checkbutton_layer_link_offsets;
+ Gtk::CheckButton checkbutton_layer_link_origins;
Gtk::CheckButton checkbutton_auto_export;
Gtk::Button button_make;
Gtk::Button button_clear;
bool get_layer_plant_flag()const { return checkbutton_layer_plant.get_active(); }
void set_layer_plant_flag(bool x) { return checkbutton_layer_plant.set_active(x); }
- bool get_layer_link_offsets_flag()const { return checkbutton_layer_link_offsets.get_active(); }
- void set_layer_link_offsets_flag(bool x) { return checkbutton_layer_link_offsets.set_active(x); }
+ bool get_layer_link_origins_flag()const { return checkbutton_layer_link_origins.get_active(); }
+ void set_layer_link_origins_flag(bool x) { return checkbutton_layer_link_origins.set_active(x); }
Real get_feather() const { return adj_feather.get_value(); }
void set_feather(Real x) { return adj_feather.set_value(x); }
else
set_layer_plant_flag(false);
- if(settings.get_value("bline.layer_link_offsets",value) && value=="0")
- set_layer_link_offsets_flag(false);
+ if(settings.get_value("bline.layer_link_origins",value) && value=="0")
+ set_layer_link_origins_flag(false);
else
- set_layer_link_offsets_flag(true);
+ set_layer_link_origins_flag(true);
if(settings.get_value("bline.auto_export",value) && value=="1")
set_auto_export_flag(true);
settings.set_value("bline.layer_region",get_layer_region_flag()?"1":"0");
settings.set_value("bline.layer_curve_gradient",get_layer_curve_gradient_flag()?"1":"0");
settings.set_value("bline.layer_plant",get_layer_plant_flag()?"1":"0");
- settings.set_value("bline.layer_link_offsets",get_layer_link_offsets_flag()?"1":"0");
+ settings.set_value("bline.layer_link_origins",get_layer_link_origins_flag()?"1":"0");
settings.set_value("bline.auto_export",get_auto_export_flag()?"1":"0");
settings.set_value("bline.id",get_id().c_str());
settings.set_value("bline.feather",strprintf("%f",get_feather()));
checkbutton_layer_outline(_("Create Outline BLine")),
checkbutton_layer_curve_gradient(_("Create Curve Gradient BLine")),
checkbutton_layer_plant(_("Create Plant BLine")),
- checkbutton_layer_link_offsets(_("Link Offsets")),
+ checkbutton_layer_link_origins(_("Link Origins")),
checkbutton_auto_export(_("Auto Export")),
button_make(_("Make")),
button_clear(_("Clear")),
options_table.attach(checkbutton_layer_region, 0, 2, 3, 4, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
options_table.attach(checkbutton_layer_plant, 0, 2, 4, 5, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
options_table.attach(checkbutton_layer_curve_gradient, 0, 2, 5, 6, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
- options_table.attach(checkbutton_layer_link_offsets, 0, 2, 6, 7, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
+ options_table.attach(checkbutton_layer_link_origins, 0, 2, 6, 7, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
options_table.attach(checkbutton_auto_export, 0, 2, 7, 8, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
options_table.attach(*manage(new Gtk::Label(_("Feather"))), 0, 1, 10, 11, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
options_table.attach(spin_feather, 1, 2, 10, 11, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
ValueNode_BLine::Handle value_node_bline(ValueNode_BLine::create(new_list));
assert(value_node_bline);
- ValueNode_Const::Handle value_node_offset(ValueNode_Const::create(Vector()));
- assert(value_node_offset);
+ ValueNode_Const::Handle value_node_origin(ValueNode_Const::create(Vector()));
+ assert(value_node_origin);
// Set the looping flag
value_node_bline->set_loop(loop_);
}
}
- // only link the curve gradient's offset parameter if the option is selected and we're creating more than one layer
- if (get_layer_link_offsets_flag() && layers_to_create > 1)
+ // only link the curve gradient's origin parameter if the option is selected and we're creating more than one layer
+ if (get_layer_link_origins_flag() && layers_to_create > 1)
{
synfigapp::Action::Handle action(synfigapp::Action::create("layer_param_connect"));
assert(action);
action->set_param("canvas",get_canvas());
action->set_param("canvas_interface",get_canvas_interface());
action->set_param("layer",layer);
- if(!action->set_param("param",String("offset")))
+ if(!action->set_param("param",String("origin")))
synfig::error("LayerParamConnect didn't like \"param\"");
- if(!action->set_param("value_node",ValueNode::Handle(value_node_offset)))
+ if(!action->set_param("value_node",ValueNode::Handle(value_node_origin)))
synfig::error("LayerParamConnect didn't like \"value_node\"");
if(!get_canvas_interface()->get_instance()->perform_action(action))
}
}
- // only link the plant's offset parameter if the option is selected and we're creating more than one layer
- if (get_layer_link_offsets_flag() && layers_to_create > 1)
+ // only link the plant's origin parameter if the option is selected and we're creating more than one layer
+ if (get_layer_link_origins_flag() && layers_to_create > 1)
{
synfigapp::Action::Handle action(synfigapp::Action::create("layer_param_connect"));
assert(action);
action->set_param("canvas",get_canvas());
action->set_param("canvas_interface",get_canvas_interface());
action->set_param("layer",layer);
- if(!action->set_param("param",String("offset")))
+ if(!action->set_param("param",String("origin")))
synfig::error("LayerParamConnect didn't like \"param\"");
- if(!action->set_param("value_node",ValueNode::Handle(value_node_offset)))
+ if(!action->set_param("value_node",ValueNode::Handle(value_node_origin)))
synfig::error("LayerParamConnect didn't like \"value_node\"");
if(!get_canvas_interface()->get_instance()->perform_action(action))
}
}
- // only link the region's offset parameter if the option is selected and we're creating more than one layer
- if (get_layer_link_offsets_flag() && layers_to_create > 1)
+ // only link the region's origin parameter if the option is selected and we're creating more than one layer
+ if (get_layer_link_origins_flag() && layers_to_create > 1)
{
synfigapp::Action::Handle action(synfigapp::Action::create("layer_param_connect"));
assert(action);
action->set_param("canvas",get_canvas());
action->set_param("canvas_interface",get_canvas_interface());
action->set_param("layer",layer);
- if(!action->set_param("param",String("offset")))
+ if(!action->set_param("param",String("origin")))
synfig::error("LayerParamConnect didn't like \"param\"");
- if(!action->set_param("value_node",ValueNode::Handle(value_node_offset)))
+ if(!action->set_param("value_node",ValueNode::Handle(value_node_origin)))
synfig::error("LayerParamConnect didn't like \"value_node\"");
if(!get_canvas_interface()->get_instance()->perform_action(action))
}
}
- // only link the outline's offset parameter if the option is selected and we're creating more than one layer
- if (get_layer_link_offsets_flag() && layers_to_create > 1)
+ // only link the outline's origin parameter if the option is selected and we're creating more than one layer
+ if (get_layer_link_origins_flag() && layers_to_create > 1)
{
synfigapp::Action::Handle action(synfigapp::Action::create("layer_param_connect"));
assert(action);
action->set_param("canvas",get_canvas());
action->set_param("canvas_interface",get_canvas_interface());
action->set_param("layer",layer);
- if(!action->set_param("param",String("offset")))
+ if(!action->set_param("param",String("origin")))
synfig::error("LayerParamConnect didn't like \"param\"");
- if(!action->set_param("value_node",ValueNode::Handle(value_node_offset)))
+ if(!action->set_param("value_node",ValueNode::Handle(value_node_origin)))
synfig::error("LayerParamConnect didn't like \"value_node\"");
if(!get_canvas_interface()->get_instance()->perform_action(action))
Gtk::CheckButton checkbutton_layer_outline;
Gtk::CheckButton checkbutton_layer_curve_gradient;
Gtk::CheckButton checkbutton_layer_plant;
- Gtk::CheckButton checkbutton_layer_link_offsets;
+ Gtk::CheckButton checkbutton_layer_link_origins;
public:
// this only counts the layers which use blines - they're the only
- // ones we link the offsets for
+ // ones we link the origins for
int layers_to_create()const
{
return
bool get_layer_plant_flag()const { return checkbutton_layer_plant.get_active(); }
void set_layer_plant_flag(bool x) { return checkbutton_layer_plant.set_active(x); }
- bool get_layer_link_offsets_flag()const { return checkbutton_layer_link_offsets.get_active(); }
- void set_layer_link_offsets_flag(bool x) { return checkbutton_layer_link_offsets.set_active(x); }
+ bool get_layer_link_origins_flag()const { return checkbutton_layer_link_origins.get_active(); }
+ void set_layer_link_origins_flag(bool x) { return checkbutton_layer_link_origins.set_active(x); }
void refresh_tool_options(); //to refresh the toolbox
else
set_layer_plant_flag(false);
- if(settings.get_value("circle.layer_link_offsets",value) && value=="0")
- set_layer_link_offsets_flag(false);
+ if(settings.get_value("circle.layer_link_origins",value) && value=="0")
+ set_layer_link_origins_flag(false);
else
- set_layer_link_offsets_flag(true);
+ set_layer_link_origins_flag(true);
}
void
settings.set_value("circle.layer_region",get_layer_region_flag()?"1":"0");
settings.set_value("circle.layer_curve_gradient",get_layer_curve_gradient_flag()?"1":"0");
settings.set_value("circle.layer_plant",get_layer_plant_flag()?"1":"0");
- settings.set_value("circle.layer_link_offsets",get_layer_link_offsets_flag()?"1":"0");
+ settings.set_value("circle.layer_link_origins",get_layer_link_origins_flag()?"1":"0");
}
void
checkbutton_layer_outline(_("Create Outline BLine")),
checkbutton_layer_curve_gradient(_("Create Curve Gradient BLine")),
checkbutton_layer_plant(_("Create Plant BLine")),
- checkbutton_layer_link_offsets(_("Link BLine Offsets"))
+ checkbutton_layer_link_origins(_("Link BLine Origins"))
{
egress_on_selection_change=true;
// Set up the tool options dialog
options_table.attach(checkbutton_layer_region, 0, 2, 9, 10, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
options_table.attach(checkbutton_layer_plant, 0, 2, 10, 11, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
options_table.attach(checkbutton_layer_curve_gradient, 0, 2, 11, 12, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
- options_table.attach(checkbutton_layer_link_offsets, 0, 2, 12, 13, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
+ options_table.attach(checkbutton_layer_link_origins, 0, 2, 12, 13, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
options_table.attach(*manage(new Gtk::Label(_("BLine Points:"))), 0, 1, 13, 14, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
options_table.attach(spin_number_of_bline_points, 1, 2, 13, 14, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
options_table.attach(*manage(new Gtk::Label(_("Point Angle Offset:"))), 0, 1, 14, 15, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
ValueNode_BLine::Handle value_node_bline(ValueNode_BLine::create(new_list));
assert(value_node_bline);
- ValueNode_Const::Handle value_node_offset(ValueNode_Const::create(Vector()));
- assert(value_node_offset);
+ ValueNode_Const::Handle value_node_origin(ValueNode_Const::create(Vector()));
+ assert(value_node_origin);
// Set the looping flag
value_node_bline->set_loop(true);
}
}
- // only link the curve gradient's offset parameter if the option is selected and we're creating more than one layer
- if (get_layer_link_offsets_flag() && layers_to_create > 1)
+ // only link the curve gradient's origin parameter if the option is selected and we're creating more than one layer
+ if (get_layer_link_origins_flag() && layers_to_create > 1)
{
synfigapp::Action::Handle action(synfigapp::Action::create("layer_param_connect"));
assert(action);
action->set_param("canvas",get_canvas());
action->set_param("canvas_interface",get_canvas_interface());
action->set_param("layer",layer);
- if(!action->set_param("param",String("offset")))
+ if(!action->set_param("param",String("origin")))
synfig::error("LayerParamConnect didn't like \"param\"");
- if(!action->set_param("value_node",ValueNode::Handle(value_node_offset)))
+ if(!action->set_param("value_node",ValueNode::Handle(value_node_origin)))
synfig::error("LayerParamConnect didn't like \"value_node\"");
if(!get_canvas_interface()->get_instance()->perform_action(action))
}
}
- // only link the plant's offset parameter if the option is selected and we're creating more than one layer
- if (get_layer_link_offsets_flag() && layers_to_create > 1)
+ // only link the plant's origin parameter if the option is selected and we're creating more than one layer
+ if (get_layer_link_origins_flag() && layers_to_create > 1)
{
synfigapp::Action::Handle action(synfigapp::Action::create("layer_param_connect"));
assert(action);
action->set_param("canvas",get_canvas());
action->set_param("canvas_interface",get_canvas_interface());
action->set_param("layer",layer);
- if(!action->set_param("param",String("offset")))
+ if(!action->set_param("param",String("origin")))
synfig::error("LayerParamConnect didn't like \"param\"");
- if(!action->set_param("value_node",ValueNode::Handle(value_node_offset)))
+ if(!action->set_param("value_node",ValueNode::Handle(value_node_origin)))
synfig::error("LayerParamConnect didn't like \"value_node\"");
if(!get_canvas_interface()->get_instance()->perform_action(action))
}
}
- // only link the region's offset parameter if the option is selected and we're creating more than one layer
- if (get_layer_link_offsets_flag() && layers_to_create > 1)
+ // only link the region's origin parameter if the option is selected and we're creating more than one layer
+ if (get_layer_link_origins_flag() && layers_to_create > 1)
{
synfigapp::Action::Handle action(synfigapp::Action::create("layer_param_connect"));
assert(action);
action->set_param("canvas",get_canvas());
action->set_param("canvas_interface",get_canvas_interface());
action->set_param("layer",layer);
- if(!action->set_param("param",String("offset")))
+ if(!action->set_param("param",String("origin")))
synfig::error("LayerParamConnect didn't like \"param\"");
- if(!action->set_param("value_node",ValueNode::Handle(value_node_offset)))
+ if(!action->set_param("value_node",ValueNode::Handle(value_node_origin)))
synfig::error("LayerParamConnect didn't like \"value_node\"");
if(!get_canvas_interface()->get_instance()->perform_action(action))
}
}
- // only link the outline's offset parameter if the option is selected and we're creating more than one layer
- if (get_layer_link_offsets_flag() && layers_to_create > 1)
+ // only link the outline's origin parameter if the option is selected and we're creating more than one layer
+ if (get_layer_link_origins_flag() && layers_to_create > 1)
{
synfigapp::Action::Handle action(synfigapp::Action::create("layer_param_connect"));
assert(action);
action->set_param("canvas",get_canvas());
action->set_param("canvas_interface",get_canvas_interface());
action->set_param("layer",layer);
- if(!action->set_param("param",String("offset")))
+ if(!action->set_param("param",String("origin")))
synfig::error("LayerParamConnect didn't like \"param\"");
- if(!action->set_param("value_node",ValueNode::Handle(value_node_offset)))
+ if(!action->set_param("value_node",ValueNode::Handle(value_node_origin)))
synfig::error("LayerParamConnect didn't like \"value_node\"");
if(!get_canvas_interface()->get_instance()->perform_action(action))
// Create the action group
synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Sketch BLine"));
- bool shift_offset = false;
- Vector shift_offset_vector;
+ bool shift_origin = false;
+ Vector shift_origin_vector;
bool join_start_no_extend=false,join_finish_no_extend=false;
synfigapp::ValueDesc start_duck_value_desc,finish_duck_value_desc;
bool extend_start=false,extend_finish=false,complete_loop=false;
(start_duck_index==0||start_duck_index==start_duck_value_node_bline->link_count()-1))
{
extend_start=true;
- shift_offset=true;
- shift_offset_vector=start_duck->get_origin();
+ shift_origin=true;
+ shift_origin_vector=start_duck->get_origin();
}
}while(0);
complete_loop=extend_finish=true;
}else{
extend_finish=true;
- shift_offset=true;
- shift_offset_vector=finish_duck->get_origin();
+ shift_origin=true;
+ shift_origin_vector=finish_duck->get_origin();
}
}
}while(0);
start_duck_value_desc=synfigapp::ValueDesc(LinkableValueNode::Handle::cast_dynamic(start_duck_value_desc.get_value_node()),0);
// fall through
case synfig::ValueBase::TYPE_VECTOR:
- if (shift_offset && shift_offset_vector != start_duck->get_origin())
+ if (shift_origin && shift_origin_vector != start_duck->get_origin())
break;
- shift_offset = true;
- shift_offset_vector = start_duck->get_origin();
+ shift_origin = true;
+ shift_origin_vector = start_duck->get_origin();
get_canvas_interface()->auto_export(start_duck_value_desc);
if (extend_finish)
if(start_duck_value_node_bline&&start_duck_value_node_bline==finish_duck_value_node_bline)
finish_duck_value_desc=synfigapp::ValueDesc(LinkableValueNode::Handle::cast_dynamic(finish_duck_value_desc.get_value_node()),0);
// fall through
case synfig::ValueBase::TYPE_VECTOR:
- if (shift_offset && shift_offset_vector != finish_duck->get_origin())
+ if (shift_origin && shift_origin_vector != finish_duck->get_origin())
break;
- shift_offset = true;
- shift_offset_vector = finish_duck->get_origin();
+ shift_origin = true;
+ shift_origin_vector = finish_duck->get_origin();
get_canvas_interface()->auto_export(finish_duck_value_desc);
if(extend_start)
if(finish_duck_value_node_bline&&start_duck_value_node_bline==finish_duck_value_node_bline)
) -new_vertex
);
- if (shift_offset)
- new_vertex=new_vertex-shift_offset_vector;
+ if (shift_origin)
+ new_vertex=new_vertex-shift_origin_vector;
bline_point.set_vertex(new_vertex);
//layer->set_description(strprintf("Stroke %d",number));
//get_canvas_interface()->signal_layer_new_description()(layer,layer->get_description());
- if (shift_offset)
+ if (shift_origin)
get_canvas_interface()->
- change_value(synfigapp::ValueDesc(layer,"offset"),shift_offset_vector);
+ change_value(synfigapp::ValueDesc(layer,"origin"),shift_origin_vector);
synfigapp::Action::Handle action(synfigapp::Action::create("layer_param_connect"));
Gtk::CheckButton checkbutton_layer_outline;
Gtk::CheckButton checkbutton_layer_curve_gradient;
Gtk::CheckButton checkbutton_layer_plant;
- Gtk::CheckButton checkbutton_layer_link_offsets;
+ Gtk::CheckButton checkbutton_layer_link_origins;
public:
// this only counts the layers which use blines - they're the only
- // ones we link the offsets for
+ // ones we link the origins for
int layers_to_create()const
{
return
bool get_layer_plant_flag()const { return checkbutton_layer_plant.get_active(); }
void set_layer_plant_flag(bool x) { return checkbutton_layer_plant.set_active(x); }
- bool get_layer_link_offsets_flag()const { return checkbutton_layer_link_offsets.get_active(); }
- void set_layer_link_offsets_flag(bool x) { return checkbutton_layer_link_offsets.set_active(x); }
+ bool get_layer_link_origins_flag()const { return checkbutton_layer_link_origins.get_active(); }
+ void set_layer_link_origins_flag(bool x) { return checkbutton_layer_link_origins.set_active(x); }
void refresh_tool_options(); //to refresh the toolbox
else
set_layer_plant_flag(false);
- if(settings.get_value("rectangle.layer_link_offsets",value) && value=="0")
- set_layer_link_offsets_flag(false);
+ if(settings.get_value("rectangle.layer_link_origins",value) && value=="0")
+ set_layer_link_origins_flag(false);
else
- set_layer_link_offsets_flag(true);
+ set_layer_link_origins_flag(true);
}
void
settings.set_value("rectangle.layer_region",get_layer_region_flag()?"1":"0");
settings.set_value("rectangle.layer_curve_gradient",get_layer_curve_gradient_flag()?"1":"0");
settings.set_value("rectangle.layer_plant",get_layer_plant_flag()?"1":"0");
- settings.set_value("rectangle.layer_link_offsets",get_layer_link_offsets_flag()?"1":"0");
+ settings.set_value("rectangle.layer_link_origins",get_layer_link_origins_flag()?"1":"0");
}
void
checkbutton_layer_outline(_("Create Outline BLine")),
checkbutton_layer_curve_gradient(_("Create Curve Gradient BLine")),
checkbutton_layer_plant(_("Create Plant BLine")),
- checkbutton_layer_link_offsets(_("Link BLine Offsets"))
+ checkbutton_layer_link_origins(_("Link BLine Origins"))
{
egress_on_selection_change=true;
load_settings();
options_table.attach(checkbutton_layer_region, 0, 2, 9, 10, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
options_table.attach(checkbutton_layer_plant, 0, 2, 10, 11, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
options_table.attach(checkbutton_layer_curve_gradient, 0, 2, 11, 12, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
- options_table.attach(checkbutton_layer_link_offsets, 0, 2, 12, 13, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
+ options_table.attach(checkbutton_layer_link_origins, 0, 2, 12, 13, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
options_table.show_all();
ValueNode_BLine::Handle value_node_bline(ValueNode_BLine::create(new_list));
assert(value_node_bline);
- ValueNode_Const::Handle value_node_offset(ValueNode_Const::create(Vector()));
- assert(value_node_offset);
+ ValueNode_Const::Handle value_node_origin(ValueNode_Const::create(Vector()));
+ assert(value_node_origin);
// Set the looping flag
value_node_bline->set_loop(true);
}
}
- // only link the curve gradient's offset parameter if the option is selected and we're creating more than one layer
- if (get_layer_link_offsets_flag() && layers_to_create > 1)
+ // only link the curve gradient's origin parameter if the option is selected and we're creating more than one layer
+ if (get_layer_link_origins_flag() && layers_to_create > 1)
{
synfigapp::Action::Handle action(synfigapp::Action::create("layer_param_connect"));
assert(action);
action->set_param("canvas",get_canvas());
action->set_param("canvas_interface",get_canvas_interface());
action->set_param("layer",layer);
- if(!action->set_param("param",String("offset")))
+ if(!action->set_param("param",String("origin")))
synfig::error("LayerParamConnect didn't like \"param\"");
- if(!action->set_param("value_node",ValueNode::Handle(value_node_offset)))
+ if(!action->set_param("value_node",ValueNode::Handle(value_node_origin)))
synfig::error("LayerParamConnect didn't like \"value_node\"");
if(!get_canvas_interface()->get_instance()->perform_action(action))
}
}
- // only link the plant's offset parameter if the option is selected and we're creating more than one layer
- if (get_layer_link_offsets_flag() && layers_to_create > 1)
+ // only link the plant's origin parameter if the option is selected and we're creating more than one layer
+ if (get_layer_link_origins_flag() && layers_to_create > 1)
{
synfigapp::Action::Handle action(synfigapp::Action::create("layer_param_connect"));
assert(action);
action->set_param("canvas",get_canvas());
action->set_param("canvas_interface",get_canvas_interface());
action->set_param("layer",layer);
- if(!action->set_param("param",String("offset")))
+ if(!action->set_param("param",String("origin")))
synfig::error("LayerParamConnect didn't like \"param\"");
- if(!action->set_param("value_node",ValueNode::Handle(value_node_offset)))
+ if(!action->set_param("value_node",ValueNode::Handle(value_node_origin)))
synfig::error("LayerParamConnect didn't like \"value_node\"");
if(!get_canvas_interface()->get_instance()->perform_action(action))
}
}
- // only link the region's offset parameter if the option is selected and we're creating more than one layer
- if (get_layer_link_offsets_flag() && layers_to_create > 1)
+ // only link the region's origin parameter if the option is selected and we're creating more than one layer
+ if (get_layer_link_origins_flag() && layers_to_create > 1)
{
synfigapp::Action::Handle action(synfigapp::Action::create("layer_param_connect"));
assert(action);
action->set_param("canvas",get_canvas());
action->set_param("canvas_interface",get_canvas_interface());
action->set_param("layer",layer);
- if(!action->set_param("param",String("offset")))
+ if(!action->set_param("param",String("origin")))
synfig::error("LayerParamConnect didn't like \"param\"");
- if(!action->set_param("value_node",ValueNode::Handle(value_node_offset)))
+ if(!action->set_param("value_node",ValueNode::Handle(value_node_origin)))
synfig::error("LayerParamConnect didn't like \"value_node\"");
if(!get_canvas_interface()->get_instance()->perform_action(action))
}
}
- // only link the outline's offset parameter if the option is selected and we're creating more than one layer
- if (get_layer_link_offsets_flag() && layers_to_create > 1)
+ // only link the outline's origin parameter if the option is selected and we're creating more than one layer
+ if (get_layer_link_origins_flag() && layers_to_create > 1)
{
synfigapp::Action::Handle action(synfigapp::Action::create("layer_param_connect"));
assert(action);
action->set_param("canvas",get_canvas());
action->set_param("canvas_interface",get_canvas_interface());
action->set_param("layer",layer);
- if(!action->set_param("param",String("offset")))
+ if(!action->set_param("param",String("origin")))
synfig::error("LayerParamConnect didn't like \"param\"");
- if(!action->set_param("value_node",ValueNode::Handle(value_node_offset)))
+ if(!action->set_param("value_node",ValueNode::Handle(value_node_origin)))
synfig::error("LayerParamConnect didn't like \"value_node\"");
if(!get_canvas_interface()->get_instance()->perform_action(action))
Gtk::CheckButton checkbutton_layer_outline;
Gtk::CheckButton checkbutton_layer_curve_gradient;
Gtk::CheckButton checkbutton_layer_plant;
- Gtk::CheckButton checkbutton_layer_link_offsets;
+ Gtk::CheckButton checkbutton_layer_link_origins;
public:
// this only counts the layers which use blines - they're the only
- // ones we link the offsets for
+ // ones we link the origins for
int layers_to_create()const
{
return
bool get_layer_plant_flag()const { return checkbutton_layer_plant.get_active(); }
void set_layer_plant_flag(bool x) { return checkbutton_layer_plant.set_active(x); }
- bool get_layer_link_offsets_flag()const { return checkbutton_layer_link_offsets.get_active(); }
- void set_layer_link_offsets_flag(bool x) { return checkbutton_layer_link_offsets.set_active(x); }
+ bool get_layer_link_origins_flag()const { return checkbutton_layer_link_origins.get_active(); }
+ void set_layer_link_origins_flag(bool x) { return checkbutton_layer_link_origins.set_active(x); }
void refresh_tool_options(); //to refresh the toolbox
else
set_layer_plant_flag(false);
- if(settings.get_value("star.layer_link_offsets",value) && value=="0")
- set_layer_link_offsets_flag(false);
+ if(settings.get_value("star.layer_link_origins",value) && value=="0")
+ set_layer_link_origins_flag(false);
else
- set_layer_link_offsets_flag(true);
+ set_layer_link_origins_flag(true);
}
void
settings.set_value("star.layer_region",get_layer_region_flag()?"1":"0");
settings.set_value("star.layer_curve_gradient",get_layer_curve_gradient_flag()?"1":"0");
settings.set_value("star.layer_plant",get_layer_plant_flag()?"1":"0");
- settings.set_value("star.layer_link_offsets",get_layer_link_offsets_flag()?"1":"0");
+ settings.set_value("star.layer_link_origins",get_layer_link_origins_flag()?"1":"0");
}
void
checkbutton_layer_outline(_("Create Outline BLine")),
checkbutton_layer_curve_gradient(_("Create Curve Gradient BLine")),
checkbutton_layer_plant(_("Create Plant BLine")),
- checkbutton_layer_link_offsets(_("Link BLine Offsets"))
+ checkbutton_layer_link_origins(_("Link BLine Origins"))
{
egress_on_selection_change=true;
options_table.attach(checkbutton_layer_region, 0, 2, 9, 10, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
options_table.attach(checkbutton_layer_plant, 0, 2, 10, 11, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
options_table.attach(checkbutton_layer_curve_gradient, 0, 2, 11, 12, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
- options_table.attach(checkbutton_layer_link_offsets, 0, 2, 12, 13, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
+ options_table.attach(checkbutton_layer_link_origins, 0, 2, 12, 13, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
options_table.attach(*manage(new Gtk::Label(_("Number of Points:"))), 0, 1, 13, 14, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
options_table.attach(spin_number_of_points, 1, 2, 13, 14, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
options_table.attach(*manage(new Gtk::Label(_("Inner Tangent:"))), 0, 1, 14, 15, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
ValueNode_BLine::Handle value_node_bline(ValueNode_BLine::create(new_list));
assert(value_node_bline);
- ValueNode_Const::Handle value_node_offset(ValueNode_Const::create(Vector()));
- assert(value_node_offset);
+ ValueNode_Const::Handle value_node_origin(ValueNode_Const::create(Vector()));
+ assert(value_node_origin);
// Set the looping flag
value_node_bline->set_loop(true);
layer=get_canvas_interface()->add_layer_to("star",canvas,depth);
layer_selection.push_back(layer);
- layer->set_param("offset",p1);
- get_canvas_interface()->signal_layer_param_changed()(layer,"offset");
+ layer->set_param("origin",p1);
+ get_canvas_interface()->signal_layer_param_changed()(layer,"origin");
layer->set_param("radius1",(p2-p1).mag());
get_canvas_interface()->signal_layer_param_changed()(layer,"radius1");
}
}
- // only link the curve gradient's offset parameter if the option is selected and we're creating more than one layer
- if (get_layer_link_offsets_flag() && layers_to_create > 1)
+ // only link the curve gradient's origin parameter if the option is selected and we're creating more than one layer
+ if (get_layer_link_origins_flag() && layers_to_create > 1)
{
synfigapp::Action::Handle action(synfigapp::Action::create("layer_param_connect"));
assert(action);
action->set_param("canvas",get_canvas());
action->set_param("canvas_interface",get_canvas_interface());
action->set_param("layer",layer);
- if(!action->set_param("param",String("offset")))
+ if(!action->set_param("param",String("origin")))
synfig::error("LayerParamConnect didn't like \"param\"");
- if(!action->set_param("value_node",ValueNode::Handle(value_node_offset)))
+ if(!action->set_param("value_node",ValueNode::Handle(value_node_origin)))
synfig::error("LayerParamConnect didn't like \"value_node\"");
if(!get_canvas_interface()->get_instance()->perform_action(action))
}
}
- // only link the plant's offset parameter if the option is selected and we're creating more than one layer
- if (get_layer_link_offsets_flag() && layers_to_create > 1)
+ // only link the plant's origin parameter if the option is selected and we're creating more than one layer
+ if (get_layer_link_origins_flag() && layers_to_create > 1)
{
synfigapp::Action::Handle action(synfigapp::Action::create("layer_param_connect"));
assert(action);
action->set_param("canvas",get_canvas());
action->set_param("canvas_interface",get_canvas_interface());
action->set_param("layer",layer);
- if(!action->set_param("param",String("offset")))
+ if(!action->set_param("param",String("origin")))
synfig::error("LayerParamConnect didn't like \"param\"");
- if(!action->set_param("value_node",ValueNode::Handle(value_node_offset)))
+ if(!action->set_param("value_node",ValueNode::Handle(value_node_origin)))
synfig::error("LayerParamConnect didn't like \"value_node\"");
if(!get_canvas_interface()->get_instance()->perform_action(action))
}
}
- // only link the region's offset parameter if the option is selected and we're creating more than one layer
- if (get_layer_link_offsets_flag() && layers_to_create > 1)
+ // only link the region's origin parameter if the option is selected and we're creating more than one layer
+ if (get_layer_link_origins_flag() && layers_to_create > 1)
{
synfigapp::Action::Handle action(synfigapp::Action::create("layer_param_connect"));
assert(action);
action->set_param("canvas",get_canvas());
action->set_param("canvas_interface",get_canvas_interface());
action->set_param("layer",layer);
- if(!action->set_param("param",String("offset")))
+ if(!action->set_param("param",String("origin")))
synfig::error("LayerParamConnect didn't like \"param\"");
- if(!action->set_param("value_node",ValueNode::Handle(value_node_offset)))
+ if(!action->set_param("value_node",ValueNode::Handle(value_node_origin)))
synfig::error("LayerParamConnect didn't like \"value_node\"");
if(!get_canvas_interface()->get_instance()->perform_action(action))
}
}
- // only link the outline's offset parameter if the option is selected and we're creating more than one layer
- if (get_layer_link_offsets_flag() && layers_to_create > 1)
+ // only link the outline's origin parameter if the option is selected and we're creating more than one layer
+ if (get_layer_link_origins_flag() && layers_to_create > 1)
{
synfigapp::Action::Handle action(synfigapp::Action::create("layer_param_connect"));
assert(action);
action->set_param("canvas",get_canvas());
action->set_param("canvas_interface",get_canvas_interface());
action->set_param("layer",layer);
- if(!action->set_param("param",String("offset")))
+ if(!action->set_param("param",String("origin")))
synfig::error("LayerParamConnect didn't like \"param\"");
- if(!action->set_param("value_node",ValueNode::Handle(value_node_offset)))
+ if(!action->set_param("value_node",ValueNode::Handle(value_node_origin)))
synfig::error("LayerParamConnect didn't like \"value_node\"");
if(!get_canvas_interface()->get_instance()->perform_action(action))