diff options
author | Hans Goudey <h.goudey@me.com> | 2020-07-21 17:12:35 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-07-21 17:12:35 +0300 |
commit | c2b0c64843084b6e4189d289fd2d201257fd9448 (patch) | |
tree | dec8ce388fe4afeae9735fe5824e0ad12dcbfe0a /source/blender/blenlib/intern/rct.c | |
parent | 696c23f284b8af2164d8d239e680301523badec1 (diff) |
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
Diffstat (limited to 'source/blender/blenlib/intern/rct.c')
-rw-r--r-- | source/blender/blenlib/intern/rct.c | 8 |
1 files changed, 8 insertions, 0 deletions
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); |