]> www.fi.muni.cz Git - evince.git/blobdiff - libview/ev-view-presentation.c
Updated Bengali translation
[evince.git] / libview / ev-view-presentation.c
index c5166023fdbbadf0653b4b4f71d5d023508c80bc..05f879923748b74165505647a21f2ec0f747f304 100644 (file)
@@ -237,7 +237,7 @@ ev_view_presentation_transition_start (EvViewPresentation *pview)
 
        duration = ev_document_transition_get_page_duration (EV_DOCUMENT_TRANSITION (pview->document),
                                                             pview->current_page);
-       if (duration > 0) {
+       if (duration >= 0) {
                        pview->trans_timeout_id =
                                g_timeout_add_seconds (duration,
                                                       (GSourceFunc) transition_next_page,
@@ -1039,6 +1039,9 @@ ev_view_presentation_expose_event (GtkWidget      *widget,
                        cairo_translate (cr, page_area.x, page_area.y);
                        page_area.x = page_area.y = 0;
 
+                       /* Try to fix rounding errors */
+                       page_area.width--;
+
                        ev_transition_animation_paint (pview->animation, cr, page_area);
                        cairo_destroy (cr);
                }
@@ -1059,12 +1062,13 @@ ev_view_presentation_expose_event (GtkWidget      *widget,
        if (gdk_rectangle_intersect (&page_area, &(event->area), &overlap)) {
                cr = gdk_cairo_create (widget->window);
 
-               cairo_translate (cr, overlap.x, overlap.y);
-               cairo_surface_set_device_offset (surface,
-                                                overlap.x - page_area.x,
-                                                overlap.y - page_area.y);
-               cairo_set_source_surface (cr, surface, 0, 0);
-               cairo_paint (cr);
+               /* Try to fix rounding errors. See bug #438760 */
+               if (overlap.width == page_area.width)
+                       overlap.width--;
+
+               cairo_rectangle (cr, overlap.x, overlap.y, overlap.width, overlap.height);
+               cairo_set_source_surface (cr, surface, page_area.x, page_area.y);
+               cairo_fill (cr);
                cairo_destroy (cr);
        }
 
@@ -1099,6 +1103,22 @@ ev_view_presentation_key_press_event (GtkWidget   *widget,
                        ev_view_presentation_set_white (pview);
 
                return TRUE;
+       case GDK_Home:
+               if (pview->state == EV_PRESENTATION_NORMAL) {
+                       ev_view_presentation_update_current_page (pview, 0);
+                       return TRUE;
+               }
+               break;
+       case GDK_End:
+               if (pview->state == EV_PRESENTATION_NORMAL) {
+                       gint page;
+
+                       page = ev_document_get_n_pages (pview->document) - 1;
+                       ev_view_presentation_update_current_page (pview, page);
+
+                       return TRUE;
+               }
+               break;
        default:
                break;
        }