**
** \legal
** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
+** Copyright (c) 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
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();
// Set up the tool options dialog
- //options_table.attach(*manage(new Gtk::Label(_("Rectangle Tool"))), 0, 2, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
- options_table.attach(entry_id, 0, 2, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
+ options_table.attach(*manage(new Gtk::Label(_("Rectangle Tool"))), 0, 2, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
+ options_table.attach(entry_id, 0, 2, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
- //expand stuff
- options_table.attach(*manage(new Gtk::Label(_("Expansion:"))), 0, 1, 2, 3, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
- options_table.attach(spin_expand, 1, 2, 2, 3, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
-
- //feather stuff
- options_table.attach(*manage(new Gtk::Label(_("Feather:"))), 0, 1, 3, 4, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
- options_table.attach(spin_feather, 1, 2, 3, 4, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
+ options_table.attach(checkbutton_layer_rectangle, 0, 2, 2, 3, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
+ options_table.attach(checkbutton_layer_outline, 0, 2, 3, 4, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
+ options_table.attach(checkbutton_layer_region, 0, 2, 4, 5, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
+ options_table.attach(checkbutton_layer_plant, 0, 2, 5, 6, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
+ options_table.attach(checkbutton_layer_curve_gradient, 0, 2, 6, 7, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
+ options_table.attach(checkbutton_layer_link_origins, 0, 2, 7, 8, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
//invert flag
- options_table.attach(checkbutton_invert, 1, 2, 4, 5, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
+ options_table.attach(checkbutton_invert, 0, 2, 8, 9, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
- options_table.attach(checkbutton_layer_rectangle, 0, 2, 7, 8, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
- options_table.attach(checkbutton_layer_outline, 0, 2, 8, 9, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
- 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);
+ //expand stuff
+ options_table.attach(*manage(new Gtk::Label(_("Expansion:"))), 0, 1, 9, 10, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
+ options_table.attach(spin_expand, 1, 2, 9, 10, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
+
+ //feather stuff
+ 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);
options_table.show_all();
{
new_list.push_back(*(new BLinePoint));
new_list[i].set_width(1);
- new_list[i].set_vertex(Point((i==0||i==1)?x_min:x_max,
- (i==0||i==3)?y_min:y_max));
+ new_list[i].set_vertex(Point((i==0||i==3)?x_min:x_max,
+ (i==0||i==1)?y_min:y_max));
new_list[i].set_tangent(Point(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->set_description(get_id());
get_canvas_interface()->signal_layer_new_description()(layer,layer->get_description());
+
+ if(get_layer_outline_flag())
+ {
+ layer->set_param("color",synfigapp::Main::get_background_color());
+ get_canvas_interface()->signal_layer_param_changed()(layer,"color");
+ }
}
///////////////////////////////////////////////////////////////////////////
}
}
- // 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))
if(event.key==EVENT_WORKAREA_MOUSE_BUTTON_DRAG && event.button==BUTTON_LEFT)
{
+ if (!point2_duck) return Smach::RESULT_OK;
point2_duck->set_point(get_work_area()->snap_point_to_grid(event.pos));
get_work_area()->queue_draw();
return Smach::RESULT_ACCEPT;