diff --git a/ChangeLog b/ChangeLog index fb0a6d70b8..391fadffa3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2003-03-21 Sven Neumann + + * app/display/gimpdisplayshell-scale.c: don't emit the "scaled" + signal from gimp_display_shell_scale_setup(). Emit it explicitely + from gimp_display_shell_scale_resize() instead. + + * app/display/gimpdisplayshell-scroll.c: call + gimp_display_shell_scale_setup() after scrolling in order to + update scrollbars and rulers. + + * app/display/gimpdisplayshell-callbacks.c + * app/display/gimpdisplayshell-handlers.c: emit the "scaled" signal + explicitely. + + * app/display/gimpdisplayshell-render.c: minor optimizations. + + * app/display/gimpdisplayshell.c: minor cleanup. + 2003-03-21 Michael Natterer * app/widgets/gimpcellrendererviewable.c diff --git a/app/display/gimpdisplayshell-callbacks.c b/app/display/gimpdisplayshell-callbacks.c index d77724a6f1..4b6920bee7 100644 --- a/app/display/gimpdisplayshell-callbacks.c +++ b/app/display/gimpdisplayshell-callbacks.c @@ -308,6 +308,7 @@ gimp_display_shell_canvas_configure (GtkWidget *widget, gimp_display_shell_scroll_clamp_offsets (shell); gimp_display_shell_scale_setup (shell); + gimp_display_shell_scaled (shell); } return TRUE; diff --git a/app/display/gimpdisplayshell-draw.c b/app/display/gimpdisplayshell-draw.c index 7ea37735f2..809e97d522 100644 --- a/app/display/gimpdisplayshell-draw.c +++ b/app/display/gimpdisplayshell-draw.c @@ -1363,11 +1363,11 @@ gimp_display_shell_draw_area (GimpDisplayShell *shell, gint w, gint h) { - gint sx, sy; - gint x1, y1; - gint x2, y2; - gint dx, dy; - gint i, j; + gint sx, sy; + gint x1, y1; + gint x2, y2; + gint dx, dy; + gint i, j; g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); @@ -1449,7 +1449,7 @@ gimp_display_shell_draw_area (GimpDisplayShell *shell, i - shell->disp_yoffset, dx, dy); -#if 0 +#ifdef STRESS_TEST /* Invalidate the projection just after we render it! */ gimp_image_invalidate_without_render (shell->gdisp->gimage, j - shell->disp_xoffset, diff --git a/app/display/gimpdisplayshell-handlers.c b/app/display/gimpdisplayshell-handlers.c index 1b4b66fd1a..a21fb4ab6d 100644 --- a/app/display/gimpdisplayshell-handlers.c +++ b/app/display/gimpdisplayshell-handlers.c @@ -307,7 +307,10 @@ gimp_display_shell_resolution_changed_handler (GimpImage *gimage, GimpDisplayShell *shell) { if (! shell->dot_for_dot) - gimp_display_shell_scale_setup (shell); + { + gimp_display_shell_scale_setup (shell); + gimp_display_shell_scaled (shell); + } gimp_statusbar_resize_cursor (GIMP_STATUSBAR (shell->statusbar)); } @@ -317,7 +320,10 @@ gimp_display_shell_unit_changed_handler (GimpImage *gimage, GimpDisplayShell *shell) { if (! shell->dot_for_dot) - gimp_display_shell_scale_setup (shell); + { + gimp_display_shell_scale_setup (shell); + gimp_display_shell_scaled (shell); + } gimp_statusbar_resize_cursor (GIMP_STATUSBAR (shell->statusbar)); } @@ -420,6 +426,7 @@ gimp_display_shell_monitor_res_notify_handler (GObject *config, if (! shell->dot_for_dot) { gimp_display_shell_scale_setup (shell); + gimp_display_shell_scaled (shell); gimp_statusbar_resize_cursor (GIMP_STATUSBAR (shell->statusbar)); diff --git a/app/display/gimpdisplayshell-render.c b/app/display/gimpdisplayshell-render.c index 45e37fa0c2..b7c10b6083 100644 --- a/app/display/gimpdisplayshell-render.c +++ b/app/display/gimpdisplayshell-render.c @@ -857,8 +857,8 @@ render_image_init_info (RenderInfo *info, info->h = h; info->scalex = SCALEFACTOR_X (shell); info->scaley = SCALEFACTOR_Y (shell); - info->src_x = UNSCALEX (shell, info->x); - info->src_y = UNSCALEY (shell, info->y); + info->src_x = (gfloat) info->x / info->scalex; + info->src_y = (gfloat) info->y / info->scaley; info->src_bpp = gimp_image_projection_bytes (shell->gdisp->gimage); info->dest = shell->render_buf; info->dest_bpp = 3; @@ -876,7 +876,7 @@ render_image_init_info (RenderInfo *info, } } -static guint* +static guint * render_image_init_alpha (gint mult) { static guint *alpha_mult = NULL; @@ -934,14 +934,10 @@ render_image_tile_fault (RenderInfo *info) guchar *scale; gint width; gint tilex; - gint tiley; gint step; gint bpp = info->src_bpp; gint x, b; - tilex = info->src_x / TILE_WIDTH; - tiley = info->src_y / TILE_HEIGHT; - tile = tile_manager_get_tile (info->src_tiles, info->src_x, info->src_y, TRUE, FALSE); @@ -957,6 +953,8 @@ render_image_tile_fault (RenderInfo *info) x = info->src_x; width = info->w; + tilex = info->src_x / TILE_WIDTH; + while (width--) { for (b = 0; b < bpp; b++) diff --git a/app/display/gimpdisplayshell-scale.c b/app/display/gimpdisplayshell-scale.c index 3aa6e1f554..3f8712e69d 100644 --- a/app/display/gimpdisplayshell-scale.c +++ b/app/display/gimpdisplayshell-scale.c @@ -150,8 +150,6 @@ gimp_display_shell_scale_setup (GimpDisplayShell *shell) gtk_widget_queue_draw (GTK_WIDGET (hruler)); gtk_widget_queue_draw (GTK_WIDGET (vruler)); - gimp_display_shell_scaled (shell); - #if 0 g_print ("offset_x: %d\n" "offset_y: %d\n" @@ -419,6 +417,7 @@ gimp_display_shell_scale_resize (GimpDisplayShell *shell, gimp_display_shell_scroll_clamp_offsets (shell); gimp_display_shell_scale_setup (shell); + gimp_display_shell_scaled (shell); if (resize_window || redisplay) gimp_display_shell_expose_full (shell); diff --git a/app/display/gimpdisplayshell-scroll.c b/app/display/gimpdisplayshell-scroll.c index 4a0acea6d2..c570eec918 100644 --- a/app/display/gimpdisplayshell-scroll.c +++ b/app/display/gimpdisplayshell-scroll.c @@ -33,6 +33,7 @@ #include "gimpdisplay.h" #include "gimpdisplay-foreach.h" #include "gimpdisplayshell.h" +#include "gimpdisplayshell-scale.h" #include "gimpdisplayshell-scroll.h" @@ -67,25 +68,21 @@ gimp_display_shell_scroll (GimpDisplayShell *shell, tool_manager_control_active (shell->gdisp->gimage->gimp, PAUSE, shell->gdisp); - gdk_window_scroll (shell->canvas->window, -x_offset, -y_offset); - /* set the offsets back to the new values */ shell->offset_x += x_offset; shell->offset_y += y_offset; + gdk_window_scroll (shell->canvas->window, -x_offset, -y_offset); + /* Make sure expose events are processed before scrolling again */ gdk_window_process_updates (shell->canvas->window, FALSE); + /* Update scrollbars and rulers */ + gimp_display_shell_scale_setup (shell); + tool_manager_control_active (shell->gdisp->gimage->gimp, RESUME, shell->gdisp); - /* Update the scrollbars */ - shell->hsbdata->value = shell->offset_x; - shell->vsbdata->value = shell->offset_y; - - gtk_adjustment_changed (shell->hsbdata); - gtk_adjustment_changed (shell->vsbdata); - gimp_display_shell_scrolled (shell); return TRUE; diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c index 7ea37735f2..809e97d522 100644 --- a/app/display/gimpdisplayshell.c +++ b/app/display/gimpdisplayshell.c @@ -1363,11 +1363,11 @@ gimp_display_shell_draw_area (GimpDisplayShell *shell, gint w, gint h) { - gint sx, sy; - gint x1, y1; - gint x2, y2; - gint dx, dy; - gint i, j; + gint sx, sy; + gint x1, y1; + gint x2, y2; + gint dx, dy; + gint i, j; g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); @@ -1449,7 +1449,7 @@ gimp_display_shell_draw_area (GimpDisplayShell *shell, i - shell->disp_yoffset, dx, dy); -#if 0 +#ifdef STRESS_TEST /* Invalidate the projection just after we render it! */ gimp_image_invalidate_without_render (shell->gdisp->gimage, j - shell->disp_xoffset,