From: Jonathan Blandford Date: Sat, 21 May 2005 04:48:26 +0000 (+0000) Subject: cast adjustmen->value to (int) before using it. Otherwise, we get off by a X-Git-Tag: EVINCE_0_3_1~3 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=e533ab12f74d16805e0d9a984f9f6383ab5d7bc6;p=evince.git cast adjustmen->value to (int) before using it. Otherwise, we get off by a Sat May 21 00:21:30 2005 Jonathan Blandford * shell/ev-view.c: (view_update_adjustments), (view_set_adjustment_values): cast adjustmen->value to (int) before using it. Otherwise, we get off by a pixel in some situations. (draw_one_page): Draw the border on expose. --- diff --git a/ChangeLog b/ChangeLog index 15b0a3eb..59e8973c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Sat May 21 00:21:30 2005 Jonathan Blandford + + * shell/ev-view.c: (view_update_adjustments), + (view_set_adjustment_values): cast adjustmen->value to (int) + before using it. Otherwise, we get off by a pixel in some + situations. + + (draw_one_page): Draw the border on expose. + Fri May 20 22:05:25 2005 Jonathan Blandford * *shell/ev-view.c: Patch from Nickolay V. Shmyrev to reset the diff --git a/shell/ev-view.c b/shell/ev-view.c index b8723ccc..d166a5ea 100644 --- a/shell/ev-view.c +++ b/shell/ev-view.c @@ -365,15 +365,15 @@ view_update_adjustments (EvView *view) return; if (view->hadjustment) { - dx = view->scroll_x - view->hadjustment->value; - view->scroll_x = view->hadjustment->value; + dx = view->scroll_x - (int) view->hadjustment->value; + view->scroll_x = (int) view->hadjustment->value; } else { view->scroll_x = 0; } if (view->vadjustment) { - dy = view->scroll_y - view->vadjustment->value; - view->scroll_y = view->vadjustment->value; + dy = view->scroll_y - (int) view->vadjustment->value; + view->scroll_y = (int) view->vadjustment->value; } else { view->scroll_y = 0; } @@ -435,7 +435,7 @@ view_set_adjustment_values (EvView *view, switch (view->pending_scroll) { case SCROLL_TO_KEEP_POSITION: new_value = CLAMP (adjustment->upper * factor, 0, adjustment->upper - adjustment->page_size); - gtk_adjustment_set_value (adjustment, new_value); + gtk_adjustment_set_value (adjustment, (int)new_value); break; case SCROLL_TO_CURRENT_PAGE: if (orientation == GTK_ORIENTATION_VERTICAL) { @@ -444,7 +444,7 @@ view_set_adjustment_values (EvView *view, break; case SCROLL_TO_CENTER: new_value = CLAMP (adjustment->upper * factor - adjustment->page_size * 0.5, 0, adjustment->upper - adjustment->page_size); - gtk_adjustment_set_value (adjustment, new_value); + gtk_adjustment_set_value (adjustment, (int)new_value); break; } @@ -1605,9 +1605,6 @@ draw_one_page (EvView *view, g_assert (view->document); - if (!gdk_rectangle_intersect (page_area, expose_area, &overlap)) - return; - ev_page_cache_get_size (view->page_cache, page, view->scale, &width, &height); @@ -1635,6 +1632,8 @@ draw_one_page (EvView *view, height == gdk_pixbuf_get_height (current_pixbuf)) scaled_image = g_object_ref (current_pixbuf); else + /* FIXME: We don't want to scale the whole area, just the right + * area of it */ scaled_image = gdk_pixbuf_scale_simple (current_pixbuf, width, height, GDK_INTERP_NEAREST);