From c2b0c64843084b6e4189d289fd2d201257fd9448 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Tue, 21 Jul 2020 10:12:35 -0400 Subject: UI: Add an outer boundary for edge panning, use in outliner Currently if you drag and drop an item from the outliner elsewhere in the Blender window, the outliner will scroll the entire time, even if the mouse is far away. This commit adds optional behavior for the edge pan operator that makes it only act if the mouse is close enough to the region. Differential Revision: https://developer.blender.org/D8193 --- source/blender/blenlib/intern/rct.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/blender/blenlib/intern') diff --git a/source/blender/blenlib/intern/rct.c b/source/blender/blenlib/intern/rct.c index ad8443683f8..bf3c8730b01 100644 --- a/source/blender/blenlib/intern/rct.c +++ b/source/blender/blenlib/intern/rct.c @@ -635,6 +635,14 @@ void BLI_rcti_resize(rcti *rect, int x, int y) rect->ymax = rect->ymin + y; } +void BLI_rcti_pad(rcti *rect, int pad_x, int pad_y) +{ + rect->xmin -= pad_x; + rect->ymin -= pad_y; + rect->xmax += pad_x; + rect->ymax += pad_y; +} + void BLI_rctf_resize(rctf *rect, float x, float y) { rect->xmin = BLI_rctf_cent_x(rect) - (x * 0.5f); -- cgit v1.2.3