Commit 24a21131 authored by Téo Mazars's avatar Téo Mazars Committed by Michael Natterer

Bug 656522 - Scaled Image Rounds Up To Nearest Pixel

Prevent gimp_coordinates_callback () to be called recursively
when x and y are chained.

One call puts all values in a consistent state, a recusive call can
cause side effects (calculations with rounded values)
parent 8bc4f008
...@@ -589,6 +589,10 @@ gimp_coordinates_callback (GtkWidget *widget, ...@@ -589,6 +589,10 @@ gimp_coordinates_callback (GtkWidget *widget,
{ {
if ((data->orig_x != 0) && (data->orig_y != 0)) if ((data->orig_x != 0) && (data->orig_y != 0))
{ {
g_signal_handlers_block_by_func (widget,
gimp_coordinates_callback,
data);
if (ROUND (new_x) != ROUND (data->last_x)) if (ROUND (new_x) != ROUND (data->last_x))
{ {
data->last_x = new_x; data->last_x = new_x;
...@@ -609,6 +613,10 @@ gimp_coordinates_callback (GtkWidget *widget, ...@@ -609,6 +613,10 @@ gimp_coordinates_callback (GtkWidget *widget,
data->last_x data->last_x
= gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0); = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0);
} }
g_signal_handlers_unblock_by_func (widget,
gimp_coordinates_callback,
data);
} }
} }
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment