[eog/gnome-3-8] Set better window size
- From: Felix Riemann <friemann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [eog/gnome-3-8] Set better window size
- Date: Fri, 10 May 2013 12:51:01 +0000 (UTC)
commit 75e934eaaf3c89ab536f0e10b2613e803c4b3af8
Author: Leonardo Donelli <learts92 gmail com>
Date: Fri May 10 01:47:37 2013 +0200
Set better window size
Make sure the window is not too big for the screen size.
The previous version did that in a way that didn't work
with some images size, particularly on 16:9 displays.
https://bugzilla.gnome.org/show_bug.cgi?id=630512
src/eog-window.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/src/eog-window.c b/src/eog-window.c
index 0b00961..f8bba59 100644
--- a/src/eog-window.c
+++ b/src/eog-window.c
@@ -1244,13 +1244,11 @@ eog_window_obtain_desired_size (EogImage *image,
if ((img_width + deco_width > screen_width) ||
(img_height + deco_height > screen_height))
{
- double factor;
+ double width_factor, height_factor, factor;
- if (img_width > img_height) {
- factor = (screen_width * 0.75 - deco_width) / (double) img_width;
- } else {
- factor = (screen_height * 0.75 - deco_height) / (double) img_height;
- }
+ width_factor = (screen_width * 0.75 - deco_width) / (double) img_width;
+ height_factor = (screen_height * 0.75 - deco_height) / (double) img_height;
+ factor = MIN (width_factor, height_factor);
img_width = img_width * factor;
img_height = img_height * factor;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]