From: Jonathan Blandford Date: Sat, 21 May 2005 02:10:42 +0000 (+0000) Subject: Patch from Nickolay V. Shmyrev to reset the adjustment when the mode X-Git-Tag: EVINCE_0_3_1~4 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=391b8337a98a416103bcf27a6a54a2d2f0e15f87;p=evince.git Patch from Nickolay V. Shmyrev to reset the adjustment when the mode Fri May 20 22:05:25 2005 Jonathan Blandford * *shell/ev-view.c: Patch from Nickolay V. Shmyrev to reset the adjustment when the mode changes, #304923 --- diff --git a/ChangeLog b/ChangeLog index fe688aea..15b0a3eb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri May 20 22:05:25 2005 Jonathan Blandford + + * *shell/ev-view.c: Patch from Nickolay V. Shmyrev to reset the + adjustment when the mode changes, #304923 + Fri May 20 02:00:03 2005 Nickolay V. Shmyrev * shell/ev-view.c: Use gdk_widget_queue_draw to remove diff --git a/shell/ev-view.c b/shell/ev-view.c index d9dddaf2..b8723ccc 100644 --- a/shell/ev-view.c +++ b/shell/ev-view.c @@ -114,8 +114,8 @@ struct _EvView { char *status; char *find_status; - int scroll_x; - int scroll_y; + gint scroll_x; + gint scroll_y; DragInfo drag_info; gboolean pressed_button; @@ -562,30 +562,40 @@ view_scroll_to_page (EvView *view, gint new_page) get_bounding_box_size (view, &max_width, &max_height); - if (view->continuous && view->vadjustment) { + if (view->vadjustment) { + if (view->continuous) { - n_rows = view->dual_page ? new_page / 2 : new_page; + n_rows = view->dual_page ? new_page / 2 : new_page; - gtk_adjustment_clamp_page(view->vadjustment, - (max_height + view->spacing) * n_rows, - (max_height + view->spacing) * n_rows + - view->vadjustment->page_size); - } else { - gtk_adjustment_set_value (view->vadjustment, - view->vadjustment->lower); + gtk_adjustment_clamp_page(view->vadjustment, + (max_height + view->spacing) * n_rows, + (max_height + view->spacing) * n_rows + + view->vadjustment->page_size); + } else { + gtk_adjustment_set_value (view->vadjustment, + view->vadjustment->lower); + } } - if (view->dual_page && view->hadjustment) { - if (new_page % 2 == 0) { - gtk_adjustment_set_value (view->hadjustment, - view->hadjustment->lower); + if (view->hadjustment) { + if (view->dual_page) { + if (new_page % 2 == 0) { + gtk_adjustment_set_value (view->hadjustment, + view->hadjustment->lower); + } else { + gtk_adjustment_clamp_page (view->hadjustment, + view->hadjustment->lower + + max_width + view->spacing, + view->hadjustment->lower + + max_width + view->spacing + + view->hadjustment->page_size); + } } else { - gtk_adjustment_clamp_page (view->hadjustment, - view->hadjustment->lower + - max_width + view->spacing, - view->hadjustment->lower + - max_width + view->spacing + - view->hadjustment->page_size); + gtk_adjustment_set_value (view->hadjustment, + CLAMP (view->hadjustment->value, + view->hadjustment->lower, + view->hadjustment->upper - + view->hadjustment->page_size)); } }