[gegl] bin: keep zoomed fit on window resize
- From: Øyvind "pippin" Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] bin: keep zoomed fit on window resize
- Date: Tue, 29 Jan 2019 23:57:13 +0000 (UTC)
commit 663f36021d7d71f559083894afa982d1ea625898
Author: Øyvind Kolås <pippin gimp org>
Date: Wed Jan 30 00:56:46 2019 +0100
bin: keep zoomed fit on window resize
bin/ui.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
---
diff --git a/bin/ui.c b/bin/ui.c
index a7dda845e..462af4f3f 100644
--- a/bin/ui.c
+++ b/bin/ui.c
@@ -5010,6 +5010,21 @@ static void gegl_ui (Mrg *mrg, void *data)
else
{
o->is_dir = 0;
+
+ { /* keep zoomed fit on resize */
+ static int prev_width = 0;
+ static int prev_height = 0;
+ int width = mrg_width (mrg);
+ int height = mrg_height (mrg);
+
+ if (o->is_fit && prev_width &&
+ (width != prev_width || height != prev_height))
+ {
+ argvs_eval ("zoom fit");
+ }
+ prev_width = width;
+ prev_height = height;
+ }
}
if (o->is_dir)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]