[Bf-blender-cvs] [e5ed9991eaf] master: UI: Consistent Area Move Snapping Locations
Harley Acheson
noreply at git.blender.org
Thu Aug 26 19:52:30 CEST 2021
Commit: e5ed9991eaf0734e4b2ea9c3580a578af1827e50
Author: Harley Acheson
Date: Thu Aug 26 10:51:30 2021 -0700
Branches: master
https://developer.blender.org/rBe5ed9991eaf0734e4b2ea9c3580a578af1827e50
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
===================================================================
M 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++) {
More information about the Bf-blender-cvs
mailing list