UI: Remove Panel Grid Snapping While Dragging

The reason to have this isn't quite clear, but it looks like a vestige
of the 2.5 transition. Removing this makes dragging panels feel
much more responsive.

Thanks to Julian Eisel @Severin for the original change.

Differential Revision: https://developer.blender.org/D7803
This commit is contained in:
2020-05-20 16:27:44 -04:00
parent 6d7dc2265f
commit 71fa460145
2 changed files with 2 additions and 3 deletions

View File

@@ -105,7 +105,6 @@ extern const char ui_radial_dir_to_numpad[8];
extern const short ui_radial_dir_to_angle[8]; extern const short ui_radial_dir_to_angle[8];
/* internal panel drawing defines */ /* internal panel drawing defines */
#define PNL_GRID (UI_UNIT_Y / 5) /* 4 default */
#define PNL_HEADER (UI_UNIT_Y * 1.2) /* 24 default */ #define PNL_HEADER (UI_UNIT_Y * 1.2) /* 24 default */
/* bit button defines */ /* bit button defines */

View File

@@ -1322,8 +1322,8 @@ static void ui_do_drag(const bContext *C, const wmEvent *event, Panel *panel)
return; return;
} }
dx = (event->x - data->startx) & ~(PNL_GRID - 1); dx = (event->x - data->startx);
dy = (event->y - data->starty) & ~(PNL_GRID - 1); dy = (event->y - data->starty);
dx *= (float)BLI_rctf_size_x(&region->v2d.cur) / (float)BLI_rcti_size_x(&region->winrct); dx *= (float)BLI_rctf_size_x(&region->v2d.cur) / (float)BLI_rcti_size_x(&region->winrct);
dy *= (float)BLI_rctf_size_y(&region->v2d.cur) / (float)BLI_rcti_size_y(&region->winrct); dy *= (float)BLI_rctf_size_y(&region->v2d.cur) / (float)BLI_rcti_size_y(&region->winrct);