Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarley Acheson <harley.acheson@gmail.com>2021-08-26 20:51:30 +0300
committerHarley Acheson <harley.acheson@gmail.com>2021-08-26 20:52:18 +0300
commite5ed9991eaf0734e4b2ea9c3580a578af1827e50 (patch)
treeb2b21ca820fcc112228eb640a6d82a3ffa7677dd /source/blender/editors/screen/screen_ops.c
parent8e5b7ac6e29ad99201fb70c6b0a02b19918c2e94 (diff)
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
Diffstat (limited to 'source/blender/editors/screen/screen_ops.c')
-rw-r--r--source/blender/editors/screen/screen_ops.c26
1 files changed, 13 insertions, 13 deletions
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++) {