Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorJonathan Blandford <jrb@redhat.com>2005-05-21 04:48:26 (GMT)
committer Jonathan Blandford <jrb@src.gnome.org>2005-05-21 04:48:26 (GMT)
commite533ab12f74d16805e0d9a984f9f6383ab5d7bc6 (patch)
tree52c73068db119e35d38f691de91083d64da307fc /shell
parent391b8337a98a416103bcf27a6a54a2d2f0e15f87 (diff)
cast adjustmen->value to (int) before using it. Otherwise, we get off by a
Sat May 21 00:21:30 2005 Jonathan Blandford <jrb@redhat.com> * 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.
Diffstat (limited to 'shell')
-rw-r--r--shell/ev-view.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/shell/ev-view.c b/shell/ev-view.c
index b8723cc..d166a5e 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);