From 4868bcec55422fd02443f6352ae622c8e4b634c9 Mon Sep 17 00:00:00 2001 From: Moritz Lipp Date: Fri, 15 Jun 2012 16:26:59 +0200 Subject: [PATCH] Update sc_adjust_window --- shortcuts.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/shortcuts.c b/shortcuts.c index 0e9c91c..f47f948 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -128,20 +128,19 @@ sc_adjust_window(girara_session_t* session, girara_argument_t* argument, } break; case ZATHURA_ADJUST_BESTFIT: - if (total_width < total_height) { - if (rotation == 0 || rotation == 180) { - zathura_document_set_scale(zathura->document, height / max_height); + if (rotation == 0 || rotation == 180) { + if (width < height) { + zathura_document_set_scale(zathura->document, width / total_width); } else { - zathura_document_set_scale(zathura->document, width / total_height); + zathura_document_set_scale(zathura->document, height / total_height); } } else { - if (rotation == 0 || rotation == 180) { - zathura_document_set_scale(zathura->document, width / total_width); + if (width < height) { + zathura_document_set_scale(zathura->document, width / total_height); } else { zathura_document_set_scale(zathura->document, height / total_width); } } - break; default: goto error_ret;