bool studio::App::use_colorspace_gamma=true;
bool studio::App::single_threaded=false;
+bool studio::App::restrict_radius_ducks=true;
static int max_recent_files_=25;
int studio::App::get_max_recent_files() { return max_recent_files_; }
value=strprintf("%i",App::auto_recover->get_timeout());
return true;
}
+ if(key=="restrict_radius_ducks")
+ {
+ value=strprintf("%i",(int)App::restrict_radius_ducks);
+ return true;
+ }
return synfigapp::Settings::get_value(key,value);
}
App::single_threaded=i;
return true;
}
+ if(key=="restrict_radius_ducks")
+ {
+ int i(atoi(value.c_str()));
+ App::restrict_radius_ducks=i;
+ return true;
+ }
return synfigapp::Settings::set_value(key,value);
}
ret.push_back("use_colorspace_gamma");
ret.push_back("single_threaded");
ret.push_back("auto_recover_backup_interval");
+ ret.push_back("restrict_radius_ducks");
return ret;
}
};
synfigapp::Main::settings().set_value("pref.distance_system","pt");
synfigapp::Main::settings().set_value("pref.use_colorspace_gamma","1");
synfigapp::Main::settings().set_value("pref.single_threaded","0");
+ synfigapp::Main::settings().set_value("pref.restrict_radius_ducks","1");
synfigapp::Main::settings().set_value("window.toolbox.pos","4 4");
}
static bool single_threaded;
+ static bool restrict_radius_ducks;
+
/*
-- ** -- S I G N A L S -------------------------------------------------------
*/
adj_recent_files(15,1,50,1,1,1),
adj_undo_depth(100,10,5000,1,1,1),
toggle_use_colorspace_gamma(_("Visually Linear Color Selection")),
- toggle_single_threaded(_("Use Only a Single Thread"))
+ toggle_single_threaded(_("Use Only a Single Thread")),
+ toggle_restrict_radius_ducks(_("Restrict Real-Valued Ducks to Top Right Quadrant"))
{
// Setup the buttons
misc_table->attach(*manage(new Gtk::Label(_("Auto Backup Interval (0 to disable)"))), 0, 1, 5, 6, Gtk::SHRINK|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0);
misc_table->attach(auto_backup_interval, 1, 2, 5, 6, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0);
+ // Misc - restrict_radius_ducks
+ misc_table->attach(toggle_restrict_radius_ducks, 0, 2, 6, 7, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0);
+
show_all_children();
}
App::distance_system=Distance::System(widget_enum->get_value());
+ // Set the restrict_radius_ducks flag
+ App::restrict_radius_ducks=toggle_restrict_radius_ducks.get_active();
+
App::save_settings();
}
// Refresh the value of the auto backup interval
auto_backup_interval.set_value(App::auto_recover->get_timeout() / 1000);
+
+ // Refresh the status of the restrict_radius_ducks flag
+ toggle_restrict_radius_ducks.set_active(App::restrict_radius_ducks);
}
GammaPattern::GammaPattern():
Widget_Enum *widget_enum;
Widget_Time auto_backup_interval;
+
+ Gtk::CheckButton toggle_restrict_radius_ducks;
public:
void set_time_format(synfig::Time::Format time_format);
throw String("Bad edit");
}
}
-#ifdef RESTRICT_RADIUS_DUCKS_TO_ONE_QUARTER
- else if ((*iter)->is_radius())
+ else if (App::restrict_radius_ducks &&
+ (*iter)->is_radius())
{
Point point((*iter)->get_point());
bool changed = false;
throw String("Bad edit");
}
}
-#endif
else
{
if(!(*iter)->signal_edited()((*iter)->get_point()))
#include <map>
#endif
-//! If defined, only allow radius ducks to be in the top right
-//! quadrant of the plane. This makes it very easy to set the
-//! corresponding parameter to zero (by dragging down and left)
-#define RESTRICT_RADIUS_DUCKS_TO_ONE_QUARTER
-
/* === T Y P E D E F S ===================================================== */
/* === C L A S S E S & S T R U C T S ======================================= */
origin[0]=(origin[0]-window_startx)/pw;
origin[1]=(origin[1]-window_starty)/ph;
-#ifdef RESTRICT_RADIUS_DUCKS_TO_ONE_QUARTER
- if((*iter)->is_radius())
+ if (App::restrict_radius_ducks &&
+ (*iter)->is_radius())
{
if (point[0] < origin[0]) point[0] = origin[0];
if (point[1] > origin[1]) point[1] = origin[1];
}
-#endif
bool selected(get_work_area()->duck_is_selected(*iter));
bool hover(*iter==hover_duck);
if(hover)
{
-#ifdef RESTRICT_RADIUS_DUCKS_TO_ONE_QUARTER
- Point point2((*iter)->get_trans_point());
- Point origin2((*iter)->get_trans_origin());
+ Real mag;
+ if (App::restrict_radius_ducks)
+ {
+ Point point((*iter)->get_trans_point());
+ Point origin((*iter)->get_trans_origin());
- if ((point2[0] - origin2[0]) * pw < 0) point2[0] = origin2[0];
- if ((point2[1] - origin2[1]) * ph > 0) point2[1] = origin2[1];
+ if ((point[0] - origin[0]) * pw < 0) point[0] = origin[0];
+ if ((point[1] - origin[1]) * ph > 0) point[1] = origin[1];
- Distance real_mag((point2-origin2).mag(),Distance::SYSTEM_UNITS);
-#else
- Distance real_mag(((*iter)->get_trans_point()-(*iter)->get_trans_origin()).mag(),Distance::SYSTEM_UNITS);
-#endif
+ mag = (point-origin).mag();
+ }
+ else
+ mag = ((*iter)->get_trans_point()-(*iter)->get_trans_origin()).mag();
+
+ Distance real_mag(mag, Distance::SYSTEM_UNITS);
real_mag.convert(App::distance_system,get_work_area()->get_rend_desc());
layout->set_text(real_mag.get_string());