+2005-06-05 Nickolay V. Shmyrev <nshmyrev@yandex.ru>
+
+ * shell/ev-view.c: (view_set_adjustment_values):
+ * shell/ev-window.c: (ev_window_cmd_file_properties):
+
+ A bit different fix for rounding problem but it has no
+ problems on startup. Make properties window transient to parent.
+
2005-06-04 Nickolay V. Shmyrev <nshmyrev@yandex.ru>
* pdf/ev-poppler.cc:
return;
factor = 1.0;
- /* We add 0.5 to the values before to average out our rounding errors.
- */
switch (view->pending_scroll) {
case SCROLL_TO_KEEP_POSITION:
- factor = (adjustment->value + 0.5) / adjustment->upper;
+ factor = (adjustment->value) / adjustment->upper;
break;
case SCROLL_TO_CURRENT_PAGE:
break;
case SCROLL_TO_CENTER:
- factor = (adjustment->value + adjustment->page_size * 0.5 + 0.5) / adjustment->upper;
+ factor = (adjustment->value + adjustment->page_size * 0.5) / adjustment->upper;
break;
}
adjustment->lower = 0;
adjustment->upper = MAX (allocation, requisition);
+ /*
+ * We add 0.5 to the values before to average out our rounding errors.
+ */
switch (view->pending_scroll) {
case SCROLL_TO_KEEP_POSITION:
- new_value = CLAMP (adjustment->upper * factor, 0, adjustment->upper - adjustment->page_size);
+ new_value = CLAMP (adjustment->upper * factor + 0.5, 0, adjustment->upper - adjustment->page_size);
gtk_adjustment_set_value (adjustment, (int)new_value);
break;
case SCROLL_TO_CURRENT_PAGE:
scroll_to_current_page (view, orientation);
break;
case SCROLL_TO_CENTER:
- new_value = CLAMP (adjustment->upper * factor - adjustment->page_size * 0.5,
+ new_value = CLAMP (adjustment->upper * factor - adjustment->page_size * 0.5 + 0.5,
0, adjustment->upper - adjustment->page_size);
gtk_adjustment_set_value (adjustment, (int)new_value);
break;
info = ev_document_get_info (document);
dialog = ev_properties_new (info, fonts);
+ gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW(window));
gtk_dialog_run (dialog);
gtk_widget_destroy (GTK_WIDGET (dialog));
ev_document_info_free (info);