From a17adb8c5b7b42a2b9e050d2f128d7639f00efae Mon Sep 17 00:00:00 2001 From: Victor Kareh Date: Fri, 6 Mar 2026 13:38:17 -0500 Subject: ev-window: Remove unnecessary calculation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Measuring image dimensions based on rotation is unnecessary, since the result is either w×h or h×w, which is commutative. --- shell/ev-window.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/shell/ev-window.c b/shell/ev-window.c index 21addeae..77093d42 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -4670,10 +4670,8 @@ ev_window_update_max_min_scale (EvWindow *window) gdouble dpi; GtkAction *action; gdouble min_width, min_height; - gdouble width, height; gdouble max_scale; guint page_cache_mb; - gint rotation = ev_document_model_get_rotation (window->priv->model); if (!window->priv->document) return; @@ -4682,9 +4680,7 @@ ev_window_update_max_min_scale (EvWindow *window) dpi = get_monitor_dpi (window) / 72.0; ev_document_get_min_page_size (window->priv->document, &min_width, &min_height); - width = (rotation == 0 || rotation == 180) ? min_width : min_height; - height = (rotation == 0 || rotation == 180) ? min_height : min_width; - max_scale = sqrt ((page_cache_mb * 1024 * 1024) / (width * dpi * 4 * height * dpi)); + max_scale = sqrt ((page_cache_mb * 1024 * 1024) / (min_width * dpi * 4 * min_height * dpi)); G_GNUC_BEGIN_IGNORE_DEPRECATIONS; action = gtk_action_group_get_action (window->priv->action_group, -- cgit v1.2.1