- if (view->sizing_mode == EV_SIZING_FIT_WIDTH) {
- requisition->width = 1;
- } else if (view->sizing_mode == EV_SIZING_BEST_FIT) {
- requisition->width = 1;
- /* FIXME: This could actually be set on one page docs or docs
- * with a strange aspect ratio. */
- /* requisition->height = 1;*/
+ switch (view->sizing_mode) {
+ case EV_SIZING_FIT_WIDTH:
+ case EV_SIZING_BEST_FIT:
+ requisition->width = 1;
+
+ break;
+ case EV_SIZING_FREE: {
+ gint max_width;
+ GtkBorder border;
+
+ ev_view_get_max_page_size (view, &max_width, NULL);
+ compute_border (view, max_width, max_width, &border);
+ requisition->width = (max_width + border.left + border.right) * 2 + (view->spacing * 3);
+ }
+ break;
+ default:
+ g_assert_not_reached ();