Commit a761ed3a authored by Jehan's avatar Jehan

app: round curve point position when displaying it as int.

Int casting results to truncation. First this is a bit counter-intuitive
as we usually expect rounding to the nearest integer. Moreover with the
new GUI updates on curve and curve tool, we end up with a mismatch as
the new Input/Output spin buttons where indeed showing rounded integers
whereas the coordinate indicator was showing truncated integers.

Make all these show same rounded value.

(cherry picked from commit 7b1af1f0)
parent b29d1ea6
......@@ -735,12 +735,12 @@ gimp_curve_view_draw (GtkWidget *widget,
/* stupid heuristic: special-case for 0..255 */
g_snprintf (buf, sizeof (buf), "x:%3d y:%3d",
(gint) (view->cursor_x *
(view->range_x_max - view->range_x_min) +
view->range_x_min),
(gint) ((1.0 - view->cursor_y) *
(view->range_y_max - view->range_y_min) +
view->range_y_min));
(gint) round (view->cursor_x *
(view->range_x_max - view->range_x_min) +
view->range_x_min),
(gint) round ((1.0 - view->cursor_y) *
(view->range_y_max - view->range_y_min) +
view->range_y_min));
}
else if (view->range_x_max == 100.0 &&
view->range_y_max == 100.0)
......
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