diff options
| author | Victor Kareh <[email protected]> | 2026-03-06 13:38:17 -0500 |
|---|---|---|
| committer | Victor Kareh <[email protected]> | 2026-04-10 11:37:36 -0400 |
| commit | a17adb8c5b7b42a2b9e050d2f128d7639f00efae (patch) | |
| tree | 65b35132a22474f9d5c4c6194d6f39d00054e05b | |
| parent | 6f3a0a2f8faa37d5e9de5f4d794e9e9c1d693c85 (diff) | |
| download | atril-a17adb8c5b7b42a2b9e050d2f128d7639f00efae.tar.bz2 atril-a17adb8c5b7b42a2b9e050d2f128d7639f00efae.tar.xz | |
ev-window: Remove unnecessary calculation
Measuring image dimensions based on rotation is unnecessary, since the
result is either w×h or h×w, which is commutative.
| -rw-r--r-- | shell/ev-window.c | 6 |
1 files changed, 1 insertions, 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, |
