[gegl] bin: consider space for property-editor and graph in zoom-to-fit code
- From: Øyvind "pippin" Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] bin: consider space for property-editor and graph in zoom-to-fit code
- Date: Wed, 30 Jan 2019 18:29:53 +0000 (UTC)
commit 78644d428a0ab047637feb5da41b68de42d1bfeb
Author: Øyvind Kolås <pippin gimp org>
Date: Wed Jan 30 19:28:59 2019 +0100
bin: consider space for property-editor and graph in zoom-to-fit code
bin/ui.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
---
diff --git a/bin/ui.c b/bin/ui.c
index 2f56fd45b..b3d40ebb3 100644
--- a/bin/ui.c
+++ b/bin/ui.c
@@ -4559,6 +4559,8 @@ static void do_commandline_run (MrgEvent *event, void *data1, void *data2)
else
{
o->show_graph = !o->show_graph;
+ if (o->is_fit)
+ zoom_to_fit (o);
}
}
@@ -5907,6 +5909,12 @@ static void zoom_to_fit (State *o)
{
width = mrg_width (mrg);
height = mrg_height (mrg);
+
+ o->graph_pan_x = -(width - height * font_size_scale * 22);
+ if (o->show_graph)
+ {
+ width = width - height * font_size_scale * 22;
+ }
}
scale = 1.0 * width / rect.width;
@@ -5921,7 +5929,6 @@ static void zoom_to_fit (State *o)
o->u += rect.x * o->scale;
o->v += rect.y * o->scale;
- o->graph_pan_x = -(width - height * font_size_scale * 22);
o->is_fit = 1;
@@ -6263,6 +6270,8 @@ cmd_toggle (COMMAND_ARGS)
if (!strcmp(argv[1], "editing"))
{
o->show_graph = !o->show_graph;
+ if (o->is_fit)
+ zoom_to_fit (o);
activate_sink_producer (o);
}
else if (!strcmp(argv[1], "fullscreen"))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]