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:
authorAaron Carlisle <carlisle.b3d@gmail.com>2021-10-21 02:49:02 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-10-21 05:15:41 +0300
commit69102786047dccdcbaee0df6307a8c3364d28fe0 (patch)
tree327a99274ee99dc576cbb2e9657f5e0c6e1c56fc /source/blender/editors/interface/view2d.c
parent2905b493fe5b569069d6035c9a17ed855c03fa17 (diff)
Cleanup: Use array as a parameter for event x/y functions
This change simplifies the parameter list for these functions and reduces the chance of typos mixing up array indices. Reviewed By: campbellbarton Ref D12950
Diffstat (limited to 'source/blender/editors/interface/view2d.c')
-rw-r--r--source/blender/editors/interface/view2d.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index 0036a812a87..ca96fde9810 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -1924,8 +1924,10 @@ void UI_view2d_offset(struct View2D *v2d, float xfac, float yfac)
* - 'v' = in vertical scroller.
* - 0 = not in scroller.
*/
-char UI_view2d_mouse_in_scrollers_ex(
- const ARegion *region, const View2D *v2d, int x, int y, int *r_scroll)
+char UI_view2d_mouse_in_scrollers_ex(const ARegion *region,
+ const View2D *v2d,
+ const int xy[2],
+ int *r_scroll)
{
const int scroll = view2d_scroll_mapped(v2d->scroll);
*r_scroll = scroll;
@@ -1933,8 +1935,8 @@ char UI_view2d_mouse_in_scrollers_ex(
if (scroll) {
/* Move to region-coordinates. */
const int co[2] = {
- x - region->winrct.xmin,
- y - region->winrct.ymin,
+ xy[0] - region->winrct.xmin,
+ xy[1] - region->winrct.ymin,
};
if (scroll & V2D_SCROLL_HORIZONTAL) {
if (IN_2D_HORIZ_SCROLL(v2d, co)) {
@@ -1978,10 +1980,10 @@ char UI_view2d_rect_in_scrollers_ex(const ARegion *region,
return 0;
}
-char UI_view2d_mouse_in_scrollers(const ARegion *region, const View2D *v2d, int x, int y)
+char UI_view2d_mouse_in_scrollers(const ARegion *region, const View2D *v2d, const int xy[2])
{
int scroll_dummy = 0;
- return UI_view2d_mouse_in_scrollers_ex(region, v2d, x, y, &scroll_dummy);
+ return UI_view2d_mouse_in_scrollers_ex(region, v2d, xy, &scroll_dummy);
}
char UI_view2d_rect_in_scrollers(const ARegion *region, const View2D *v2d, const rcti *rect)