On Fri, Aug 07, 2009 at 06:15:49AM +0200, Niels Kristian Bech Jensen wrote: > I have found a couple of problems with the patch. > > 1. Try flipping an image 90 degrees in some direction and then hit reset. You > get a garbled preview image.
If I am seeing the same problem you are, the same thing happens if you just type 0 into the spinner box -- it's an issue with the rotation UI code and the crop area. I'm not sure where it could/should get fixed. > 2. I get this warning when running ufraw: (ufraw:9964): Gtk-CRITICAL **: > gtk_adjustment_set_value: assertion `GTK_IS_ADJUSTMENT (adjustment)' failed Fixed. I was setting the value of the adjustment while the UI was frozen, resulting in trying to set an uninitialized value. A new version of the patch is attached. > I have seen the doubled adjustment steps in the zoom adjustment. Try zooming > to 50% using the 1:1 zoom button and then use the spinner to zoom out. It > jumps to 48%. I think it is some sort of round-off error maybe in floor() but > I have not investigated it. I'll take a look at that. -- Bruce Guenter <[email protected]> http://untroubled.org/
diff --git a/ufraw_preview.c b/ufraw_preview.c
index bb5a4e1..0052d9b 100644
--- a/ufraw_preview.c
+++ b/ufraw_preview.c
@@ -2863,20 +2863,19 @@ GtkWidget *stock_icon_button(const gchar *stock_id,
* are valid. Try to preserve them over a rotate forth and back and try to
* preserve their geometry.
*/
-static void adjustment_update_rotation(GtkAdjustment *adj, gpointer user_data)
+static void set_rotation_angle(preview_data *data, double angle)
{
- preview_data *data = get_preview_data(adj);
int d;
- (void)user_data;
- data->unnormalized_angle = gtk_adjustment_get_value(adj);
+ if (data->FreezeDialog)
+ return;
+
/* Normalize the "unnormalized" value displayed to the user to
* -180 < a <= 180, though we later normalize to an orientation
* and flip plus 0 <= a < 90 rotation for processing. */
- data->unnormalized_angle = remainder(data->unnormalized_angle, 360);
- gtk_adjustment_set_value(adj, data->unnormalized_angle);
- if (data->FreezeDialog)
- return;
+ data->unnormalized_angle = remainder(angle, 360);
+ gtk_adjustment_set_value(data->RotationAdjustment,
+ data->unnormalized_angle);
CFG->rotationAngle = data->unnormalized_angle;
CFG->orientation = data->reference_orientation;
ufraw_normalize_rotation(data->UF);
@@ -2920,6 +2919,20 @@ static void adjustment_update_rotation(GtkAdjustment
*adj, gpointer user_data)
update_scales(data);
}
+static void adjustment_update_rotation(GtkAdjustment *adj, gpointer user_data)
+{
+ preview_data *data = get_preview_data(adj);
+ set_rotation_angle(data, gtk_adjustment_get_value(adj));
+ (void)user_data;
+}
+
+static void adjustment_reset_rotation(GtkAdjustment *adj, gpointer user_data)
+{
+ preview_data *data = get_preview_data(adj);
+ set_rotation_angle(data, 0);
+ (void)user_data;
+}
+
GtkWidget *reset_button(const char *tip, GCallback callback, void *data)
{
return stock_icon_button(GTK_STOCK_REFRESH, tip, callback, data);
@@ -4764,18 +4777,13 @@ static void transformations_fill_interface(preview_data
*data,
data->unnormalized_angle = CFG->rotationAngle;
data->reference_orientation = CFG->orientation;
table = GTK_TABLE(table_with_frame(page, NULL, TRUE));
- label = gtk_label_new(_("Rotation"));
- gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, 0, 0, 0, 0);
- data->RotationAdjustment = GTK_ADJUSTMENT(gtk_adjustment_new(
- data->unnormalized_angle, -1e100, 1e100, 0.5, 5, 0));
- data->RotationSpin = GTK_SPIN_BUTTON(gtk_spin_button_new(
- data->RotationAdjustment, 0.5, 3));
- g_object_set_data(G_OBJECT(data->RotationAdjustment), "Parent-Widget",
- data->RotationSpin);
- g_signal_connect(G_OBJECT(data->RotationAdjustment), "value-changed",
- G_CALLBACK(adjustment_update_rotation), NULL);
- gtk_table_attach(GTK_TABLE(table), GTK_WIDGET(data->RotationSpin),
- 1, 2, 0, 1, 0, 0, 0, 0);
+ data->RotationAdjustment = adjustment_scale(
+ table, 0, 0, _("Rotation"),
+ data->unnormalized_angle, &data->unnormalized_angle,
+ -360, 360, 0.1, 1, 2, _("Rotation Angle"),
+ G_CALLBACK(adjustment_update_rotation),
+ &data->ResetRotationAdjustment, _("Reset Rotation Angle"),
+ G_CALLBACK(adjustment_reset_rotation));
/* End of transformation page */
}
diff --git a/ufraw_ui.h b/ufraw_ui.h
index 9150f06..2c67ba4 100644
--- a/ufraw_ui.h
+++ b/ufraw_ui.h
@@ -83,7 +83,6 @@ typedef struct {
GtkSpinButton *ShrinkSpin;
GtkSpinButton *HeightSpin;
GtkSpinButton *WidthSpin;
- GtkSpinButton *RotationSpin;
/* We need the adjustments for update_scale() */
GtkAdjustment *WBTuningAdjustment;
GtkAdjustment *TemperatureAdjustment;
@@ -112,6 +111,7 @@ typedef struct {
GtkAdjustment *HeightAdjustment;
GtkAdjustment *WidthAdjustment;
GtkAdjustment *RotationAdjustment;
+ GtkWidget *ResetRotationAdjustment;
GtkAdjustment *GrayscaleMixers[3];
#ifdef HAVE_LENSFUN
/* The GtkEntry with camera maker/model name */
pgpZFMzwE3Tgu.pgp
Description: PGP signature
------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________ ufraw-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ufraw-devel
