Bill Skaggs <weskaggs@primate.ucdavis.edu>

* libgimpwidgets/gimpwidgets.c (gimp_coordinates_callback):
	Make sure last_x and last_y are set to values that match
	those returned by gimp_size_entry_get_refval(),
	fixes bug #163951.
This commit is contained in:
William Skaggs 2005-01-18 18:09:19 +00:00
parent c4d65e756d
commit 4f698cd30c
2 changed files with 21 additions and 6 deletions

View File

@ -1,3 +1,10 @@
2005-01-18 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* libgimpwidgets/gimpwidgets.c (gimp_coordinates_callback):
Make sure last_x and last_y are set to values that match
those returned by gimp_size_entry_get_refval(),
fixes bug #163951.
2005-01-18 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* app/dialogs/info-dialog.c: disconnect callbacks to prevent crash

View File

@ -1078,20 +1078,24 @@ gimp_coordinates_callback (GtkWidget *widget,
if (new_x != gcd->last_x)
{
gcd->last_x = new_x;
gcd->last_y = new_y = (new_x * gcd->orig_y) / gcd->orig_x;
new_y = (new_x * gcd->orig_y) / gcd->orig_x;
g_signal_stop_emission_by_name (widget, "value_changed");
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (widget), 1,
new_y);
gcd->last_y
= gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1);
}
else if (new_y != gcd->last_y)
{
gcd->last_y = new_y;
gcd->last_x = new_x = (new_y * gcd->orig_x) / gcd->orig_y;
new_x = (new_y * gcd->orig_x) / gcd->orig_y;
g_signal_stop_emission_by_name (widget, "value_changed");
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (widget), 0,
new_x);
gcd->last_x
= gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0);
}
}
}
@ -1099,17 +1103,21 @@ gimp_coordinates_callback (GtkWidget *widget,
{
if (new_x != gcd->last_x)
{
gcd->last_y = new_y = gcd->last_x = new_x;
new_y = new_x;
g_signal_stop_emission_by_name (widget, "value_changed");
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (widget), 1, new_x);
gcd->last_y = gcd->last_x
= gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1);
}
else if (new_y != gcd->last_y)
{
gcd->last_x = new_x = gcd->last_y = new_y;
new_x = new_y;
g_signal_stop_emission_by_name (widget, "value_changed");
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (widget), 0, new_y);
gcd->last_x = gcd->last_y
= gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0);
}
}
}