From 8515f25e258cf227af495bf1a5fcdf07f8bb1a11 Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Tue, 27 Feb 2024 13:06:19 +0100 Subject: [PATCH] fix regression in translate (check instances out of bound) affecting copy_objects() --- src/move.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/move.c b/src/move.c index ec20caa9..19a2b707 100644 --- a/src/move.c +++ b/src/move.c @@ -840,10 +840,10 @@ void copy_objects(int what) new_prop_string(xctx->instances, xctx->inst[n].prop_ptr, /* sets also inst[].instname */ tclgetboolvar("disable_unique_names")); hash_names(xctx->instances, XINSERT); - symbol_bbox(xctx->instances, - &xctx->inst[xctx->instances].x1, &xctx->inst[xctx->instances].y1, - &xctx->inst[xctx->instances].x2, &xctx->inst[xctx->instances].y2); - xctx->instances++; + xctx->instances++; /* symbol_bbox calls translate and translate must have updated xctx->instances */ + symbol_bbox(xctx->instances-1, + &xctx->inst[xctx->instances-1].x1, &xctx->inst[xctx->instances-1].y1, + &xctx->inst[xctx->instances-1].x2, &xctx->inst[xctx->instances-1].y2); } /* if(xctx->sel_array[i].type == ELEMENT) */ } /* for(i = 0; i < xctx->lastsel; ++i) */ xctx->need_reb_sel_arr=1;