From 54a1b1399e44d84ad3fdf4c2ca761146dcb3175d Mon Sep 17 00:00:00 2001 From: Guillem <guillembartrina@gmail.com> Date: Mon, 10 Aug 2020 09:10:09 +0200 Subject: [PATCH] fix for computing bounding box of selected objects. get rid of INT_MAX --- pd/src/g_editor.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pd/src/g_editor.c b/pd/src/g_editor.c index e2e2c65ff..021f964e5 100644 --- a/pd/src/g_editor.c +++ b/pd/src/g_editor.c @@ -6305,12 +6305,13 @@ static void canvas_dofancycopy(t_canvas *x, t_binbuf **object, t_binbuf **connec t_outconnect *oc; t_binbuf *b = binbuf_new(); int maxx, maxy, minx, miny, numobj = 0; - maxx = maxy = 0; - minx = miny = INT_MAX; binbuf_addv(b, "ssiiiisi;", gensym("#N"), gensym("canvas"), 0, 0, 450, 300, gensym("subpatch"), 0); + gobj_getrect(x->gl_editor->e_selection->sel_what, x, + &minx, &miny, &maxx, &maxy); + /* compute global rect */ for (y = x->gl_list; y; y = y->g_next) { -- GitLab