+ if (! view->document) {
+ requisition->width = 1;
+ requisition->height = 1;
+ return;
+ }
+
+ ev_document_get_page_size (view->document, -1,
+ &width, &height);
+ ev_document_misc_get_page_border_size (width, height, &border);
+
+ switch (view->sizing_mode) {
+ case EV_SIZING_BEST_FIT:
+ requisition->width = MIN_SCALE * ((float) width) / view->scale;
+ requisition->height = MIN_SCALE * ((float) height) / view->scale;
+ break;
+ case EV_SIZING_FIT_WIDTH:
+ requisition->width = MIN_SCALE * ((float) width) / view->scale;
+ requisition->height = height + border.top + border.bottom;
+ requisition->height += view->spacing * 2;
+ break;
+ case EV_SIZING_FREE:
+ requisition->width = width + border.left + border.right;
+ requisition->height = height + border.top + border.bottom;
+ requisition->width += view->spacing * 2;
+ requisition->height += view->spacing * 2;
+ break;