From 201b02f2a740290796eedfc8346fabe13e945ad2 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 16 Oct 2017 13:18:50 +1100 Subject: Cleanup: simplify lasso reallocation Remove unneeded define, double allocations when increasing. --- source/blender/windowmanager/intern/wm_gesture.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/windowmanager/intern/wm_gesture.c') diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c index 311b501a179..f66efa72908 100644 --- a/source/blender/windowmanager/intern/wm_gesture.c +++ b/source/blender/windowmanager/intern/wm_gesture.c @@ -97,11 +97,11 @@ wmGesture *WM_gesture_new(bContext *C, const wmEvent *event, int type) } else if (ELEM(type, WM_GESTURE_LINES, WM_GESTURE_LASSO)) { short *lasso; - gesture->customdata = lasso = MEM_callocN(2 * sizeof(short) * WM_LASSO_MIN_POINTS, "lasso points"); + gesture->points_alloc = 1024; + gesture->customdata = lasso = MEM_mallocN(sizeof(short[2]) * gesture->points_alloc, "lasso points"); lasso[0] = event->x - sx; lasso[1] = event->y - sy; gesture->points = 1; - gesture->size = WM_LASSO_MIN_POINTS; } return gesture; -- cgit v1.2.3