Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_gesture.c
| Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | else if (ELEM(type, WM_GESTURE_LINES, WM_GESTURE_LASSO)) { | ||||
| lasso[0] = event->x - gesture->winrct.xmin; | lasso[0] = event->x - gesture->winrct.xmin; | ||||
| lasso[1] = event->y - gesture->winrct.ymin; | lasso[1] = event->y - gesture->winrct.ymin; | ||||
| gesture->points = 1; | gesture->points = 1; | ||||
| } | } | ||||
| return gesture; | return gesture; | ||||
| } | } | ||||
| void WM_gesture_end(bContext *C, wmGesture *gesture) | static void wm_gesture_end_with_window(wmWindow *win, wmGesture *gesture) | ||||
| { | { | ||||
| wmWindow *win = CTX_wm_window(C); | |||||
| if (win->tweak == gesture) { | if (win->tweak == gesture) { | ||||
| win->tweak = NULL; | win->tweak = NULL; | ||||
| } | } | ||||
| BLI_remlink(&win->gesture, gesture); | BLI_remlink(&win->gesture, gesture); | ||||
| MEM_freeN(gesture->customdata); | MEM_freeN(gesture->customdata); | ||||
| WM_generic_user_data_free(&gesture->user_data); | WM_generic_user_data_free(&gesture->user_data); | ||||
| MEM_freeN(gesture); | MEM_freeN(gesture); | ||||
| } | } | ||||
| void WM_gesture_end(bContext *C, wmGesture *gesture) | |||||
| { | |||||
| wm_gesture_end_with_window(CTX_wm_window(C), gesture); | |||||
| } | |||||
| void WM_gestures_free_all(wmWindow *win) | |||||
| { | |||||
| while (win->gesture.first) { | |||||
| wm_gesture_end_with_window(win, win->gesture.first); | |||||
| } | |||||
| } | |||||
| void WM_gestures_remove(bContext *C) | void WM_gestures_remove(bContext *C) | ||||
| { | { | ||||
| wmWindow *win = CTX_wm_window(C); | wmWindow *win = CTX_wm_window(C); | ||||
| while (win->gesture.first) { | while (win->gesture.first) { | ||||
| WM_gesture_end(C, win->gesture.first); | WM_gesture_end(C, win->gesture.first); | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 411 Lines • Show Last 20 Lines | |||||