Re: [Gimp-developer] patch: change default units for colors/map/rotate colors, from radians over pi (!) to degrees
On Wed, 2012-12-05 at 11:05 +0100, Michael Natterer wrote: > Yes please file a bug done, with patch attached, 689712 Liam -- Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/ Pictures from old books: http://fromoldbooks.org/ Ankh: irc.sorcery.net irc.gnome.org freenode/#xml ___ gimp-developer-list mailing list gimp-developer-list@gnome.org https://mail.gnome.org/mailman/listinfo/gimp-developer-list
Re: [Gimp-developer] patch: change default units for colors/map/rotate colors, from radians over pi (!) to degrees
On Tue, 2012-12-04 at 22:42 -0500, Liam R E Quin wrote: > On Tue, 2012-12-04 at 23:49 +0100, Michael Natterer wrote: > > > Yeah, go ahead and push to 2-8 and master please. > > Thanks. > > Someone else will have to do that, I'm afraid - I've never had commit > access, nor (I think) a gnome.org account. Unbelievable :) > Or I can squirrel the patch away in bugzilla if you prefer. Yes please file a bug, I'm pretty busy at the moment, --mitch ___ gimp-developer-list mailing list gimp-developer-list@gnome.org https://mail.gnome.org/mailman/listinfo/gimp-developer-list
Re: [Gimp-developer] patch: change default units for colors/map/rotate colors, from radians over pi (!) to degrees
On Tue, 2012-12-04 at 23:49 +0100, Michael Natterer wrote: > Yeah, go ahead and push to 2-8 and master please. Thanks. Someone else will have to do that, I'm afraid - I've never had commit access, nor (I think) a gnome.org account. Or I can squirrel the patch away in bugzilla if you prefer. If I start doing patches more often I'll see if I can get an account. Sorry to be (as so often) a pain! Liam -- Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/ Pictures from old books: http://fromoldbooks.org/ Ankh: irc.sorcery.net irc.gnome.org freenode/#xml ___ gimp-developer-list mailing list gimp-developer-list@gnome.org https://mail.gnome.org/mailman/listinfo/gimp-developer-list
Re: [Gimp-developer] patch: change default units for colors/map/rotate colors, from radians over pi (!) to degrees
On Tue, 2012-12-04 at 15:08 -0500, Liam R E Quin wrote: > The "colors/map/rotate colors" dialog box uses angles to show colour > ranges; it defaults to using radians over pi for the angle. > > I'm pretty sure more Gimp users will want degrees than radians over pi > for rotating colours. There's a pull-down menu to change it, but it's > irritating to have to do that every time, and it seems crazy to add a > preference. > > The enclosed patch changes the default to degrees. > > It does not affect the actual plugin, only the GIMP dialog box. > > The change would presumably also affect the documentation. > > Minor note, the indenting and code style in this plugin is somewhat > varied, e.g. with spaces in foo () in some places and not - foo() - in > others. I tried to make the few lines I changed more gimpish. Yeah, go ahead and push to 2-8 and master please. --mitch ___ gimp-developer-list mailing list gimp-developer-list@gnome.org https://mail.gnome.org/mailman/listinfo/gimp-developer-list
Re: [Gimp-developer] patch: change default units for colors/map/rotate colors, from radians over pi (!) to degrees
On Tue, Dec 4, 2012 at 3:08 PM, Liam R E Quin wrote: > The "colors/map/rotate colors" dialog box uses angles to show colour > ranges; it defaults to using radians over pi for the angle. > > I'm pretty sure more Gimp users will want degrees than radians over pi > for rotating colours. There's a pull-down menu to change it, but it's > irritating to have to do that every time, and it seems crazy to add a > preference. This seems like a much saner default. Rockwalrus ___ gimp-developer-list mailing list gimp-developer-list@gnome.org https://mail.gnome.org/mailman/listinfo/gimp-developer-list
[Gimp-developer] patch: change default units for colors/map/rotate colors, from radians over pi (!) to degrees
The "colors/map/rotate colors" dialog box uses angles to show colour ranges; it defaults to using radians over pi for the angle. I'm pretty sure more Gimp users will want degrees than radians over pi for rotating colours. There's a pull-down menu to change it, but it's irritating to have to do that every time, and it seems crazy to add a preference. The enclosed patch changes the default to degrees. It does not affect the actual plugin, only the GIMP dialog box. The change would presumably also affect the documentation. Minor note, the indenting and code style in this plugin is somewhat varied, e.g. with spaces in foo () in some places and not - foo() - in others. I tried to make the few lines I changed more gimpish. Liam -- Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/ Pictures from old books: http://fromoldbooks.org/ Ankh: irc.sorcery.net irc.gnome.org freenode/#xml The barefoot typographer - http://www.holoweb.net/~liam/ diff --git a/plug-ins/color-rotate/color-rotate-dialog.c b/plug-ins/color-rotate/color-rotate-dialog.c index 8d9abaa..6ffc5a1 100644 --- a/plug-ins/color-rotate/color-rotate-dialog.c +++ b/plug-ins/color-rotate/color-rotate-dialog.c @@ -54,11 +54,13 @@ /* Defines */ -#define INITIAL_ALPHA 0 -#define INITIAL_BETA G_PI_2 -#define INITIAL_GRAY_SAT 0.0 -#define INITIAL_GRAY_RSAT 0.0 -#define INITIAL_GRAY_HUE 0.0 +#define INITIAL_ALPHA 0.0 +#define INITIAL_ALPHA_RADIANS 0.0 +#define INITIAL_BETA 90.0 +#define INITIAL_BETA_RADIANS ((INITIAL_BETA / 360) * 2 * G_PI) +#define INITIAL_GRAY_SAT 0.0 +#define INITIAL_GRAY_RSAT 0.0 +#define INITIAL_GRAY_HUE 0.0 #define RANGE_ADJUST_MASK GDK_EXPOSURE_MASK | \ GDK_ENTER_NOTIFY_MASK | \ @@ -201,8 +203,8 @@ rcm_create_one_circle (gint height, st = g_new (RcmCircle, 1); st->angle = g_new (RcmAngle, 1); - st->angle->alpha = INITIAL_ALPHA; - st->angle->beta = INITIAL_BETA; + st->angle->alpha = INITIAL_ALPHA_RADIANS; + st->angle->beta = INITIAL_BETA_RADIANS; st->angle->cw_ccw = 1; /** Main: Circle: create (main) frame **/ @@ -300,9 +302,10 @@ rcm_create_one_circle (gint height, 0, GTK_EXPAND, 5, 5); st->angle->alpha = INITIAL_ALPHA; - adj = (GtkAdjustment *) gtk_adjustment_new(st->angle->alpha, 0.0, 2.0, 0.0001, 0.001, 0.0); - st->alpha_entry = entry = gtk_spin_button_new(adj, 0.01, 4); - gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(entry), TRUE); + adj = (GtkAdjustment *) gtk_adjustment_new(st->angle->alpha, + 0.0, 360.0, 0.01, 1.0, 0.0); + st->alpha_entry = entry = gtk_spin_button_new(adj, 0.01, 2); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON(entry), TRUE); gtk_table_attach(GTK_TABLE(legend_table), entry, 1,2, 0,1, GTK_EXPAND|GTK_FILL, GTK_EXPAND, 2, 4); gtk_widget_show(entry); @@ -325,10 +328,9 @@ rcm_create_one_circle (gint height, gtk_table_attach (GTK_TABLE (legend_table), label, 3,4, 0,1, 0, GTK_EXPAND, 4, 4); - st->angle->beta = INITIAL_BETA; - adj = (GtkAdjustment *) gtk_adjustment_new (st->angle->beta, - 0.0, 2.0, 0.0001, 0.001, 0.0); - st->beta_entry = entry = gtk_spin_button_new (adj, 0.01, 4); + st->angle->beta = INITIAL_BETA_RADIANS; + adj = (GtkAdjustment *) gtk_adjustment_new (INITIAL_BETA, 0.0, 360.0, 0.01, 1.0, 0.0); + st->beta_entry = entry = gtk_spin_button_new (adj, 0.01, 2); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (entry), TRUE); gtk_table_attach (GTK_TABLE (legend_table), entry, 4,5, 0,1, GTK_EXPAND|GTK_FILL, GTK_EXPAND, 2, 4); diff --git a/plug-ins/color-rotate/color-rotate.c b/plug-ins/color-rotate/color-rotate.c index 4a168aa..e4056ab 100644 --- a/plug-ins/color-rotate/color-rotate.c +++ b/plug-ins/color-rotate/color-rotate.c @@ -66,7 +66,7 @@ RcmParams Current = { SELECTION, /* SELECTION ONLY */ TRUE,/* REAL TIME */ - RADIANS_OVER_PI, /* START IN RADIANS OVER PI */ + DEGREES, /* START IN DEGREES */ GRAY_TO }; ___ gimp-developer-list mailing list gimp-developer-list@gnome.org https://mail.gnome.org/mailman/listinfo/gimp-developer-list