Index: app/display/gimpdisplayshell.c =================================================================== --- app/display/gimpdisplayshell.c (revision 24445) +++ app/display/gimpdisplayshell.c (working copy) @@ -1180,8 +1180,8 @@ gimp_display_shell_scale_changed (GimpDi shell->x_dest_inc = gimp_image_get_width (image); shell->y_dest_inc = gimp_image_get_height (image); - shell->x_src_dec = ceil (gimp_image_get_width (image) * shell->scale_x); - shell->y_src_dec = ceil (gimp_image_get_height (image) * shell->scale_y); + shell->x_src_dec = SCALEX (shell, gimp_image_get_width (image)); + shell->y_src_dec = SCALEY (shell, gimp_image_get_height (image)); } void Index: app/display/gimpdisplayshell-transform.c =================================================================== --- app/display/gimpdisplayshell-transform.c (revision 24445) +++ app/display/gimpdisplayshell-transform.c (working copy) @@ -54,8 +54,8 @@ gimp_display_shell_transform_coordinate *display_coords = *image_coords; - display_coords->x = shell->scale_x * image_coords->x; - display_coords->y = shell->scale_y * image_coords->y; + display_coords->x = SCALEX (shell, image_coords->x); + display_coords->y = SCALEY (shell, image_coords->y); display_coords->x += - shell->offset_x + shell->disp_xoffset; display_coords->y += - shell->offset_y + shell->disp_yoffset; @@ -115,8 +115,8 @@ gimp_display_shell_transform_xy (GimpDis y += offset_y; } - tx = PROJ_ROUND64 (x * shell->x_src_dec) + (shell->x_dest_inc >> 1) - 1; - ty = PROJ_ROUND64 (y * shell->y_src_dec) + (shell->y_dest_inc >> 1) - 1; + tx = PROJ_ROUND64 (x * shell->x_src_dec); + ty = PROJ_ROUND64 (y * shell->y_src_dec); tx /= shell->x_dest_inc; ty /= shell->y_dest_inc; @@ -223,8 +223,8 @@ gimp_display_shell_transform_xy_f (Gimp gimp_item_offsets (item, &offset_x, &offset_y); } - *nx = shell->scale_x * (x + offset_x) - shell->offset_x; - *ny = shell->scale_y * (y + offset_y) - shell->offset_y; + *nx = SCALEX (shell, x + offset_x) - shell->offset_x; + *ny = SCALEY (shell, y + offset_y) - shell->offset_y; *nx += shell->disp_xoffset; *ny += shell->disp_yoffset; @@ -314,10 +314,8 @@ gimp_display_shell_transform_points (Gim x = points[i*2] + offset_x; y = points[i*2+1] + offset_y; - x = PROJ_ROUND64 (shell->x_src_dec * x + - (shell->x_dest_inc >> 1) - 1) / shell->x_dest_inc; - y = PROJ_ROUND64 (shell->y_src_dec * y + - (shell->y_dest_inc >> 1) - 1) / shell->y_dest_inc; + x = PROJ_ROUND64 (x * shell->x_src_dec) / shell->x_dest_inc; + y = PROJ_ROUND64 (y * shell->y_src_dec) / shell->y_dest_inc; coords[i].x = CLAMP (x + shell->disp_xoffset - shell->offset_x, G_MININT, G_MAXINT); @@ -366,10 +364,8 @@ gimp_display_shell_transform_coords (Gim x = image_coords[i].x + offset_x; y = image_coords[i].y + offset_y; - x = PROJ_ROUND64 (shell->x_src_dec * x + - (shell->x_dest_inc >> 1) - 1) / shell->x_dest_inc; - y = PROJ_ROUND64 (shell->y_src_dec * y + - (shell->y_dest_inc >> 1) - 1) / shell->y_dest_inc; + x = PROJ_ROUND64 (shell->x_src_dec * x) / shell->x_dest_inc; + y = PROJ_ROUND64 (shell->y_src_dec * y) / shell->y_dest_inc; disp_coords[i].x = CLAMP (x + shell->disp_xoffset - shell->offset_x, G_MININT, G_MAXINT); @@ -421,14 +417,10 @@ gimp_display_shell_transform_segments (G y1 = src_segs[i].y1 + offset_y; y2 = src_segs[i].y2 + offset_y; - x1 = (x1 * shell->x_src_dec + - (shell->x_dest_inc >> 1) - 1) / shell->x_dest_inc; - x2 = (x2 * shell->x_src_dec + - (shell->x_dest_inc >> 1) - 1) / shell->x_dest_inc; - y1 = (y1 * shell->y_src_dec + - (shell->y_dest_inc >> 1) - 1) / shell->y_dest_inc; - y2 = (y2 * shell->y_src_dec + - (shell->y_dest_inc >> 1) - 1) / shell->y_dest_inc; + x1 = PROJ_ROUND64 (x1 * shell->x_src_dec) / shell->x_dest_inc; + x2 = PROJ_ROUND64 (x2 * shell->x_src_dec) / shell->x_dest_inc; + y1 = PROJ_ROUND64 (y1 * shell->y_src_dec) / shell->y_dest_inc; + y2 = PROJ_ROUND64 (y2 * shell->y_src_dec) / shell->y_dest_inc; dest_segs[i].x1 = CLAMP (x1 + shell->disp_xoffset - shell->offset_x, G_MININT, G_MAXINT); Index: app/display/gimpdisplayshell-selection.c =================================================================== --- app/display/gimpdisplayshell-selection.c (revision 24445) +++ app/display/gimpdisplayshell-selection.c (working copy) @@ -740,6 +740,7 @@ selection_window_state_event (GtkWidget return FALSE; } + static gboolean selection_visibility_notify_event (GtkWidget *shell, GdkEventVisibility *event, Index: app/display/gimpdisplayshell-render.c =================================================================== --- app/display/gimpdisplayshell-render.c (revision 24445) +++ app/display/gimpdisplayshell-render.c (working copy) @@ -591,13 +591,11 @@ gimp_display_shell_render_info_scale (Re info->scalex = shell->scale_x * (1 << level); info->scaley = shell->scale_y * (1 << level); - info->src_y = (gdouble) info->y / info->scaley; - /* use Bresenham like stepping */ info->x_dest_inc = shell->x_dest_inc; info->x_src_dec = shell->x_src_dec << level; - info->dx_start = ((gint64) info->x_dest_inc) * info->x + info->x_dest_inc/2; + info->dx_start = ((gint64) info->x_dest_inc) * info->x; info->src_x = info->dx_start / info->x_src_dec; info->dx_start = info->dx_start % info->x_src_dec; @@ -605,7 +603,7 @@ gimp_display_shell_render_info_scale (Re info->y_dest_inc = shell->y_dest_inc; info->y_src_dec = shell->y_src_dec << level; - info->dy_start = ((gint64) info->y_dest_inc * info->y) + info->y_dest_inc/2; + info->dy_start = ((gint64) info->y_dest_inc) * info->y; info->src_y = info->dy_start / info->y_src_dec; info->dy_start = info->dy_start % info->y_src_dec;