From e5ed9991eaf0734e4b2ea9c3580a578af1827e50 Mon Sep 17 00:00:00 2001 From: Harley Acheson Date: Thu, 26 Aug 2021 10:51:30 -0700 Subject: UI: Consistent Area Move Snapping Locations Change Area Move snapping locations to even 12ths, rather than current eights and thirds, so snap distances are consistent sizes. Also adds snapping at minimum and maximum locations. see D11938 for details and illustrations. Differential Revision: https://developer.blender.org/D11938 Reviewed by Hans Goudey --- source/blender/editors/screen/screen_ops.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'source/blender/editors/screen/screen_ops.c') diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index cff3ecfbbd3..daac196a90c 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -1738,19 +1738,19 @@ static int area_snap_calc_location(const bScreen *screen, int snap_dist_best = INT_MAX; { const float div_array[] = { - /* Middle. */ - 1.0f / 2.0f, - /* Thirds. */ - 1.0f / 3.0f, - 2.0f / 3.0f, - /* Quarters. */ - 1.0f / 4.0f, - 3.0f / 4.0f, - /* Eighth. */ - 1.0f / 8.0f, - 3.0f / 8.0f, - 5.0f / 8.0f, - 7.0f / 8.0f, + 0.0f, + 1.0f / 12.0f, + 2.0f / 12.0f, + 3.0f / 12.0f, + 4.0f / 12.0f, + 5.0f / 12.0f, + 6.0f / 12.0f, + 7.0f / 12.0f, + 8.0f / 12.0f, + 9.0f / 12.0f, + 10.0f / 12.0f, + 11.0f / 12.0f, + 1.0f, }; /* Test the snap to the best division. */ for (int i = 0; i < ARRAY_SIZE(div_array); i++) { -- cgit v1.2.3