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:
authorCampbell Barton <ideasman42@gmail.com>2019-02-11 07:34:19 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-02-11 07:48:46 +0300
commit43156d830470fbbcd89bc1bd4b1f32d3348ba7a9 (patch)
tree605c05ee3b73459c8acf594024073e148dbfa5cb /source/blender/editors/interface/interface.c
parent1daaa74b089875562117b3978e5fe9783c21bbf5 (diff)
Preferences: remove tweak/drag threshold distinction
Currently the preferences have both tweak and drag threshold, this is confusing because most actions users would consider dragging use the 'tweak' setting. Now one drag threshold is used for both, with a maximum limit of half the button unit-size in case of dragging UI elements.
Diffstat (limited to 'source/blender/editors/interface/interface.c')
-rw-r--r--source/blender/editors/interface/interface.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index f30d3c6ce25..47514f9f65c 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -157,6 +157,16 @@ void ui_block_to_window_rctf(const ARegion *ar, uiBlock *block, rctf *rct_dst, c
ui_block_to_window_fl(ar, block, &rct_dst->xmax, &rct_dst->ymax);
}
+float ui_block_to_window_scale(const ARegion *ar, uiBlock *block)
+{
+ /* We could have function for this to avoid dummy arg. */
+ float dummy_x;
+ float min_y = 0, max_y = 1;
+ ui_block_to_window_fl(ar, block, &dummy_x, &min_y);
+ ui_block_to_window_fl(ar, block, &dummy_x, &max_y);
+ return max_y - min_y;
+}
+
/* for mouse cursor */
void ui_window_to_block_fl(const ARegion *ar, uiBlock *block, float *x, float *y)
{